diff --git a/files/alpine/repositories b/files/alpine/repositories new file mode 100644 index 0000000..3a81b6a --- /dev/null +++ b/files/alpine/repositories @@ -0,0 +1,2 @@ +https://dl-cdn.alpinelinux.org/alpine/latest-stable/main +https://dl-cdn.alpinelinux.org/alpine/latest-stable/community diff --git a/tasks/alpine.yml b/tasks/alpine.yml index 213858b..30d5de4 100644 --- a/tasks/alpine.yml +++ b/tasks/alpine.yml @@ -1,6 +1,14 @@ --- - name: setup ssh - include: ssh.yml + include_tasks: ssh.yml + +- name: install apk repositories + copy: + src: alpine/repositories + dest: /etc/apk/repositories + owner: root + group: root + mode: 0644 - name: install basics connection: local @@ -13,20 +21,15 @@ - "rc-update add dropbear" - "rc-service dropbear restart" - #- name: enable dropbear - # connection: local - # delegate_to: localhost - # command: - # cmd: "/usr/bin/incus exec {{ inventory_hostname }} -- rc-update add dropbear" - # - #- name: start dropbear - # connection: local - # delegate_to: localhost - # command: - # cmd: "/usr/bin/incus exec {{ inventory_hostname }} -- rc-service dropbear restart" +- name: upgrade container + apk: + upgrade: true + update_cache: true - name: install software - apk: name={{ alpine_software }} state=present update_cache=yes + apk: + name: "{{ alpine_software }}" + state: "present" - name: deploy syslog config copy: diff --git a/tasks/archlinux.yml b/tasks/archlinux.yml index d7f6d7d..4811374 100644 --- a/tasks/archlinux.yml +++ b/tasks/archlinux.yml @@ -2,20 +2,20 @@ - name: install basics connection: local delegate_to: localhost - raw: "lxc exec {{ inventory_hostname }} -- /usr/sbin/pacman -Syu --noconfirm python3 openssh wget" + raw: "incus exec {{ inventory_hostname }} -- /usr/sbin/pacman -Syu --noconfirm python3 openssh wget" - name: setup ssh - include: ssh.yml + include_tasks: ssh.yml - name: enable sshd connection: local delegate_to: localhost - raw: "lxc exec {{ inventory_hostname }} -- systemctl enable sshd" + raw: "incus exec {{ inventory_hostname }} -- systemctl enable sshd" - name: start dropbear connection: local delegate_to: localhost - raw: "lxc exec {{ inventory_hostname }} -- systemctl restart sshd" + raw: "incus exec {{ inventory_hostname }} -- systemctl restart sshd" - name: install software pacman: name={{ archlinux_software }} state=present update_cache=yes