You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
---
|
|
|
|
- name: Enable services on installed system.
|
|
|
|
command: arch-chroot {{ partitioning_root_mount_point }}
|
|
|
|
systemctl enable {{ item }}
|
|
|
|
with_items:
|
|
|
|
- sshd
|
|
|
|
- NetworkManager
|
|
|
|
- fstrim.timer
|
|
|
|
changed_when: true
|
|
|
|
|
|
|
|
- name: Get primary network interface.
|
|
|
|
set_fact:
|
|
|
|
net_interface: '{{ ansible_interfaces | reject("match", "^lo$") | first }}'
|
|
|
|
|
|
|
|
- name: Set ip address.
|
|
|
|
set_fact:
|
|
|
|
net_ip: '{{ ansible_facts[net_interface]["ipv4"]["address"] }}'
|
|
|
|
|
|
|
|
- name: Set gateway.
|
|
|
|
set_fact:
|
|
|
|
net_gateway: '{{ (ansible_facts[net_interface]["ipv4"]["network"] | split("."))[:3] | join(".") }}.1'
|
|
|
|
|
|
|
|
- name: Set nameservers.
|
|
|
|
set_fact:
|
|
|
|
net_dns: '{{ ansible_facts["dns"]["nameservers"] | join(";") }};8.8.8.8;'
|
|
|
|
|
|
|
|
- name: Create static ip config.
|
|
|
|
template:
|
|
|
|
src: files/static.nmconnection
|
|
|
|
dest: "{{ partitioning_root_mount_point }}/etc/NetworkManager/system-connections/static.nmconnection"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|
|
|
|
|
|
|
|
- name: Make sure root's .ssh directory exists.
|
|
|
|
file:
|
|
|
|
state: directory
|
|
|
|
path: "{{ partitioning_root_mount_point }}/root/.ssh"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0700
|
|
|
|
|
|
|
|
- name: Make sure temporary key is in root's authorized_keys
|
|
|
|
authorized_key:
|
|
|
|
state: present
|
|
|
|
user: root
|
|
|
|
path: "{{ partitioning_root_mount_point }}/root/.ssh/authorized_keys"
|
|
|
|
key: "{{ tmp_pub_key }}"
|
|
|
|
manage_dir: true
|
|
|
|
|
|
|
|
- name: Update root password.
|
|
|
|
command: arch-chroot {{ partitioning_root_mount_point }} sh -c "echo root:{{ configure_root_password }} | chpasswd"
|
|
|
|
changed_when: true
|