Skip to content
Snippets Groups Projects
Commit 00cafde1 authored by Amin Vakil's avatar Amin Vakil Committed by Kristian Klausen
Browse files

install_arch: init pacman keyring on first boot

Creates a systemd service which executes these commands on first boot:

pacman-key --init

pacman-key --populate archlinux

Also it makes sure /etc/pacman.d/gnupg is not absent.

At last it removes /etc/machine-id to make sure systemd launches first
boot services.
parent e0e52552
No related branches found
No related tags found
1 merge request!493Pacman keyring init
[Unit]
Description=Initializes Pacman keyring
Before=sshd.service
ConditionFirstBoot=yes
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/pacman-key --init
ExecStart=/usr/bin/pacman-key --populate archlinux
[Install]
WantedBy=multi-user.target
......@@ -150,8 +150,17 @@
register: chroot_grub_mkconfig
changed_when: "chroot_grub_mkconfig.rc == 0"
- name: setup pacman-init.service on first boot
copy: src=pacman-init.service dest=/mnt/etc/systemd/system/ owner=root group=root mode=0644
- name: remove generated keyring in the installation process
file: path=/mnt/etc/pacman.d/gnupg state=absent
- name: make sure /etc/machine-id is absent
file: path=/mnt/etc/machine-id state=absent
- name: enable services inside chroot
command: chroot /mnt systemctl enable sshd systemd-networkd systemd-resolved fstrim.timer
command: chroot /mnt systemctl enable sshd systemd-networkd systemd-resolved fstrim.timer pacman-init
register: chroot_systemd_services
changed_when: "chroot_systemd_services.rc == 0"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment