epel
This commit is contained in:
parent
2dbde310c7
commit
dd0f23fdef
5 changed files with 62 additions and 13 deletions
|
|
@ -17,3 +17,6 @@ all:
|
||||||
ansible_host: 192.168.99.41
|
ansible_host: 192.168.99.41
|
||||||
kuber-node01:
|
kuber-node01:
|
||||||
ansible_host: 192.168.99.42
|
ansible_host: 192.168.99.42
|
||||||
|
|
||||||
|
rocky9-template:
|
||||||
|
ansible_host: 192.168.99.43
|
||||||
|
|
@ -2,15 +2,15 @@
|
||||||
- name: Initial Rocky9 Configuration
|
- name: Initial Rocky9 Configuration
|
||||||
|
|
||||||
hosts:
|
hosts:
|
||||||
- ca
|
- rocky9-template
|
||||||
# kuber-node01
|
# kuber-node01
|
||||||
# - 172.20.21.193
|
# - 172.20.21.193
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
#ansible_ssh_user: root
|
ansible_ssh_user: root
|
||||||
#ansible_ssh_password: nmklop90
|
ansible_ssh_password: nmklop90
|
||||||
reboot_system: false
|
reboot_system: false
|
||||||
#hostname: rocky9-template.local.mrwho.ru
|
hostname: rocky9-template.local.mrwho.ru
|
||||||
roles:
|
roles:
|
||||||
- users
|
- users
|
||||||
- rocky9
|
- rocky9
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,8 @@
|
||||||
# - 172.20.21.1
|
# - 172.20.21.1
|
||||||
# - 192.168.1.1
|
# - 192.168.1.1
|
||||||
#reboot_system: false
|
#reboot_system: false
|
||||||
|
|
||||||
|
epel_repo_url: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_facts.distribution_major_version }}.noarch.rpm"
|
||||||
|
epel_repo_gpg_key_url: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_facts.distribution_major_version }}"
|
||||||
|
epel_repofile_path: "/etc/yum.repos.d/epel.repo"
|
||||||
|
epel_repo_disable: false
|
||||||
|
|
|
||||||
44
roles/rocky9/tasks/install-epel-repo.yml
Normal file
44
roles/rocky9/tasks/install-epel-repo.yml
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
---
|
||||||
|
- name: Check if EPEL repo is already configured.
|
||||||
|
stat:
|
||||||
|
path: "{{ epel_repofile_path }}"
|
||||||
|
register: epel_repofile_result
|
||||||
|
|
||||||
|
- name: Import EPEL GPG key.
|
||||||
|
rpm_key:
|
||||||
|
key: "{{ epel_repo_gpg_key_url }}"
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
until: result is succeeded
|
||||||
|
retries: 5
|
||||||
|
delay: 10
|
||||||
|
when: not epel_repofile_result.stat.exists
|
||||||
|
ignore_errors: "{{ ansible_check_mode }}"
|
||||||
|
|
||||||
|
- name: Install EPEL repo.
|
||||||
|
yum:
|
||||||
|
name: "{{ epel_repo_url }}"
|
||||||
|
state: present
|
||||||
|
register: result
|
||||||
|
until: result is succeeded
|
||||||
|
retries: 5
|
||||||
|
delay: 10
|
||||||
|
when: not epel_repofile_result.stat.exists
|
||||||
|
|
||||||
|
- name: Disable Main EPEL repo.
|
||||||
|
ini_file:
|
||||||
|
path: "/etc/yum.repos.d/epel.repo"
|
||||||
|
section: epel
|
||||||
|
option: enabled
|
||||||
|
value: "{{ epel_repo_disable | ternary(0, 1) }}"
|
||||||
|
no_extra_spaces: true
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Install soft from EPEL
|
||||||
|
ansible.builtin.dnf:
|
||||||
|
name:
|
||||||
|
- screen
|
||||||
|
- unrar
|
||||||
|
- htop
|
||||||
|
- btop
|
||||||
|
state: present
|
||||||
|
|
@ -33,16 +33,13 @@
|
||||||
name: crb
|
name: crb
|
||||||
state: enabled
|
state: enabled
|
||||||
|
|
||||||
- name: Install EPEL repo
|
#- name: Install EPEL repo
|
||||||
ansible.builtin.dnf:
|
# ansible.builtin.include_tasks: install-epel-repo.yml
|
||||||
name:
|
|
||||||
- epel-release
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Upgrade all packages
|
#- name: Upgrade all packages
|
||||||
ansible.builtin.dnf:
|
# ansible.builtin.dnf:
|
||||||
name: "*"
|
# name: "*"
|
||||||
state: latest
|
# state: latest
|
||||||
|
|
||||||
- name: Install soft
|
- name: Install soft
|
||||||
ansible.builtin.dnf:
|
ansible.builtin.dnf:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue