alpine: enable automatic upgrades only for virtual machines
And factor out VM stuff into a separate file.
This commit is contained in:
parent
e2c9acd872
commit
1b206517b6
2 changed files with 28 additions and 26 deletions
|
|
@ -65,7 +65,6 @@
|
||||||
- acl
|
- acl
|
||||||
- git
|
- git
|
||||||
- iproute2
|
- iproute2
|
||||||
- logrotate
|
|
||||||
- nftables
|
- nftables
|
||||||
- procps
|
- procps
|
||||||
- rsync
|
- rsync
|
||||||
|
|
@ -98,33 +97,11 @@
|
||||||
|
|
||||||
- meta: flush_handlers
|
- meta: flush_handlers
|
||||||
|
|
||||||
- name: Enable QEMU guest agent
|
|
||||||
when: is_virtual
|
|
||||||
block:
|
|
||||||
- name: Install QEMU guest agent package
|
|
||||||
package:
|
|
||||||
name: qemu-guest-agent
|
|
||||||
|
|
||||||
- name: Enable QEMU guest agent service
|
|
||||||
service:
|
|
||||||
name: qemu-guest-agent
|
|
||||||
enabled: yes
|
|
||||||
state: started
|
|
||||||
|
|
||||||
- name: Install automatic upgrade script
|
|
||||||
copy:
|
|
||||||
dest: /etc/periodic/weekly/
|
|
||||||
src: unattended-upgrade
|
|
||||||
mode: 0755
|
|
||||||
|
|
||||||
- name: Configure log rotation for automatic upgrades
|
|
||||||
copy:
|
|
||||||
dest: /etc/logrotate.d/unattended-upgrade
|
|
||||||
src: unattended-upgrade.logrotate
|
|
||||||
mode: 0644
|
|
||||||
|
|
||||||
- name: Set authorized SSH keys
|
- name: Set authorized SSH keys
|
||||||
authorized_key:
|
authorized_key:
|
||||||
user: root
|
user: root
|
||||||
exclusive: true
|
exclusive: true
|
||||||
key: "{{ ssh_keys | join('\n') }}"
|
key: "{{ ssh_keys | join('\n') }}"
|
||||||
|
|
||||||
|
- when: is_virtual
|
||||||
|
include_tasks: vm.yml
|
||||||
|
|
|
||||||
25
roles/alpine/tasks/vm.yml
Normal file
25
roles/alpine/tasks/vm.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
- name: Install QEMU guest agent package
|
||||||
|
package:
|
||||||
|
name: qemu-guest-agent
|
||||||
|
|
||||||
|
- name: Enable QEMU guest agent service
|
||||||
|
service:
|
||||||
|
name: qemu-guest-agent
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
|
||||||
|
- name: Install logrotate
|
||||||
|
package:
|
||||||
|
name: logrotate
|
||||||
|
|
||||||
|
- name: Install automatic upgrade script
|
||||||
|
copy:
|
||||||
|
dest: /etc/periodic/weekly/
|
||||||
|
src: unattended-upgrade
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Configure log rotation for automatic upgrades
|
||||||
|
copy:
|
||||||
|
dest: /etc/logrotate.d/unattended-upgrade
|
||||||
|
src: unattended-upgrade.logrotate
|
||||||
|
mode: "0644"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue