feat: reworked most of the ansible playbooks and roles
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
---
|
||||
|
||||
- block:
|
||||
- name: "Updating the guest operating system."
|
||||
ansible.builtin.apt:
|
||||
@@ -11,3 +12,10 @@
|
||||
ansible.builtin.apt:
|
||||
name: "{{ additional_packages[ansible_os_family] }}"
|
||||
state: latest # noqa package-latest
|
||||
|
||||
- name: "Installing cloud-init."
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name: cloud-init
|
||||
state: latest
|
||||
when: enable_cloudinit == 'true' and ansible_distribution_version | int >= 11
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
---
|
||||
|
||||
- name: "Getting guest operating system information."
|
||||
ansible.builtin.debug:
|
||||
msg: "OS: {{ ansible_distribution }} Version: {{ ansible_distribution_version }} Family: {{ ansible_os_family }}"
|
||||
|
||||
- name: Prepare the {{ ansible_facts['distribution'] }} guest operating system
|
||||
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||
when: "ansible_facts['distribution'] == 'Debian'"
|
||||
@@ -13,7 +17,7 @@
|
||||
when: "ansible_facts['distribution'] in ['RedHat', 'CentOS', 'Rocky', 'AlmaLinux', 'OracleLinux']"
|
||||
|
||||
- name: Prepare the {{ ansible_facts['distribution'] }} guest operating system
|
||||
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||
when: "ansible_facts['distribution'] == 'Suse'"
|
||||
include_tasks: suse.yml
|
||||
when: "ansible_facts['distribution'] in ['openSUSE Leap', 'Suse']"
|
||||
|
||||
...
|
||||
@@ -15,5 +15,12 @@
|
||||
ansible.builtin.dnf:
|
||||
name: "{{ additional_packages[ansible_os_family] }}"
|
||||
state: latest # noqa package-latest
|
||||
when: ansible_distribution_major_version | int > 8
|
||||
|
||||
- name: "Installing cloud-init."
|
||||
become: true
|
||||
ansible.builtin.dnf:
|
||||
name: cloud-init
|
||||
state: latest
|
||||
when: enable_cloudinit == 'true' and ansible_distribution_version | int >= 8
|
||||
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version | int >= 8
|
||||
|
||||
|
||||
@@ -1,9 +1,29 @@
|
||||
---
|
||||
|
||||
- name: Updating the operating system
|
||||
ansible.builtin.zypper:
|
||||
name: "*"
|
||||
state: latest
|
||||
update_cache: true
|
||||
- block:
|
||||
- name: Updating the operating system
|
||||
ansible.builtin.zypper:
|
||||
name: "*"
|
||||
state: latest
|
||||
update_cache: true
|
||||
|
||||
...
|
||||
- name: Installing additional packages
|
||||
ansible.builtin.zypper:
|
||||
name: "{{ additional_packages[ansible_os_family] }}"
|
||||
state: latest
|
||||
|
||||
- name: "Configure cloud-init."
|
||||
block:
|
||||
- name: "Add the SUSE OSS repo."
|
||||
become: true
|
||||
community.general.zypper_repository:
|
||||
name: repo-oss
|
||||
repo: "http://download.opensuse.org/distribution/leap/15.5/repo/oss/"
|
||||
auto_import_keys: true
|
||||
|
||||
- name: "Installing cloud-init."
|
||||
become: true
|
||||
ansible.builtin.zypper:
|
||||
name: cloud-init
|
||||
state: latest
|
||||
when: enable_cloudinit == 'true'
|
||||
|
||||
Reference in New Issue
Block a user