History rewrite
This commit is contained in:
17
ansible/roles/base/tasks/debian.yml
Normal file
17
ansible/roles/base/tasks/debian.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: "Updating the guest operating system."
|
||||
apt:
|
||||
force_apt_get: true
|
||||
name: "*"
|
||||
state: latest # noqa package-latest
|
||||
update_cache: "yes"
|
||||
|
||||
- name: "Installing additional packages."
|
||||
apt:
|
||||
name:
|
||||
- bash-completion
|
||||
- curl
|
||||
- wget
|
||||
- unzip
|
||||
- ca-certificates
|
||||
state: latest # noqa package-latest
|
||||
10
ansible/roles/base/tasks/main.yml
Normal file
10
ansible/roles/base/tasks/main.yml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
- name: "Prepare the {{ ansible_facts['distribution'] }} guest operating system."
|
||||
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||
when: "ansible_facts['distribution'] == 'Debian'"
|
||||
- name: "Prepare the {{ ansible_facts['distribution'] }} guest operating system."
|
||||
include_tasks: "{{ ansible_facts['distribution'] | lower }}.yml"
|
||||
when: "ansible_facts['distribution'] == 'Ubuntu'"
|
||||
- name: "Prepare the {{ ansible_facts['distribution'] }} guest operating system."
|
||||
include_tasks: redhat.yml
|
||||
when: "ansible_facts['distribution'] in ['RedHat', 'CentOS', 'Rocky', 'AlmaLinux', 'OracleLinux']"
|
||||
41
ansible/roles/base/tasks/redhat.yml
Normal file
41
ansible/roles/base/tasks/redhat.yml
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
|
||||
- name: "Checking Red Hat Subscription Manager status."
|
||||
ansible.builtin.shell: "subscription-manager refresh"
|
||||
when: "ansible_facts['distribution'] == 'RedHat'"
|
||||
|
||||
- name: "Updating the guest operating system."
|
||||
ansible.builtin.dnf:
|
||||
name: "*"
|
||||
state: latest # noqa package-latest
|
||||
update_cache: "yes"
|
||||
when: "ansible_facts['distribution_major_version'] >= \"8\""
|
||||
|
||||
- name: "Installing additional packages."
|
||||
ansible.builtin.dnf:
|
||||
name:
|
||||
- curl
|
||||
- wget
|
||||
- unzip
|
||||
- ca-certificates
|
||||
state: latest # noqa package-latest
|
||||
when: "ansible_facts['distribution_major_version'] >= \"8\""
|
||||
|
||||
- name: "Updating the guest operating system."
|
||||
when: "ansible_facts['distribution_major_version'] <= \"7\""
|
||||
ansible.builtin.yum:
|
||||
name: "*"
|
||||
state: latest # noqa package-latest
|
||||
update_cache: "yes"
|
||||
|
||||
- name: "Installing additional packages."
|
||||
when: "ansible_facts['distribution_major_version'] <= \"7\""
|
||||
ansible.builtin.yum:
|
||||
name:
|
||||
- curl
|
||||
- wget
|
||||
- unzip
|
||||
- ca-certificates
|
||||
state: latest # noqa package-latest
|
||||
|
||||
...
|
||||
17
ansible/roles/base/tasks/ubuntu.yml
Normal file
17
ansible/roles/base/tasks/ubuntu.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: "Updating the guest operating system."
|
||||
apt:
|
||||
force_apt_get: true
|
||||
name: "*"
|
||||
state: latest # noqa package-latest
|
||||
update_cache: "yes"
|
||||
|
||||
- name: "Installing additional packages."
|
||||
apt:
|
||||
name:
|
||||
- bash-completion
|
||||
- curl
|
||||
- wget
|
||||
- unzip
|
||||
- ca-certificates
|
||||
state: latest # noqa package-latest
|
||||
Reference in New Issue
Block a user