This commit is contained in:
aynic.os
2021-07-14 20:38:30 +01:00
parent e1f9ef7de9
commit 3ffea66ba8
101 changed files with 3601 additions and 939 deletions
+10 -9
View File
@@ -2,11 +2,15 @@
# file: tasks/cloudinit.yml
- name: cloudinit - install cloud-init packages
when: hosts_cloudinit_enable|default(false) and ansible_os_family|lower != "alpine"
package: name="cloud-init" state="present"
become: yes
when: hosts_enable_cloudinit|default(false) and ansible_os_family|lower != "alpine"
- name: cloudinit - install cloud-init packages
- name: cloudinit - alpine - install cloud-init packages
when: hosts_cloudinit_enable|default(false) and ansible_os_family|lower == "alpine"
with_items:
- { "name": "cloud-init", "state": "present" }
- { "name": "cloud-init-openrc", "state": "present" }
apk:
name: "{{ item.name}}"
state: "{{ item.state }}"
@@ -16,32 +20,29 @@
- http://dl-cdn.alpinelinux.org/alpine/edge/community
- http://dl-cdn.alpinelinux.org/alpine/latest-stable/main
- http://dl-cdn.alpinelinux.org/alpine/latest-stable/community
with_items:
- { "name": "cloud-init", "state": "present" }
- { "name": "cloud-init-openrc", "state": "present" }
become: yes
when: hosts_enable_cloudinit|default(false) and ansible_os_family|lower == "alpine"
- name: cloudinit - update /etc/cloud/cloud.cfg
when: hosts_cloudinit_enable|default(false)
template:
src: cloud.cfg.j2
dest: /etc/cloud/cloud.cfg
force: yes
when: hosts_enable_cloudinit|default(false)
- name: cloudinit - activate service
when: hosts_cloudinit_enable|default(false) and ansible_service_mgr|lower != "openrc"
service:
name: cloud-init
state: started
enabled: yes
when: hosts_enable_cloudinit|default(false) and ansible_service_mgr|lower != "openrc"
become: yes
- name: cloudinit - activate service (openrc)
when: hosts_cloudinit_enable|default(false) and ansible_service_mgr|lower == "openrc"
service:
name: cloud-init
state: started
enabled: yes
runlevel: boot
when: hosts_enable_cloudinit|default(false) and ansible_service_mgr|lower == "openrc"
become: yes