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.
cloud-images/ansible/roles/setup_cloud_init/tasks/main.yml

25 lines
557 B

- name: Install cloud-init
ansible.builtin.dnf:
name:
- cloud-init
- cloud-utils-growpart
- dracut-config-generic
state: present
- name: Enable cloud-init services
ansible.builtin.service:
name: "{{ item }}"
enabled: true
with_items:
- cloud-config
- cloud-init
- cloud-init-local
- cloud-final
- name: Configure cloud-init user name
ansible.builtin.replace:
dest: /etc/cloud/cloud.cfg
regexp: '^(\s+name:).*$'
replace: "\\1 {{ cloud_init_user }}"
when: cloud_init_user | length > 0