Skip to content

Commit f78c6c3

Browse files
committed
Fixes geerlingguy#501: Update some references from yum to dnf. Hopefully not breaking.
1 parent c1b8c4f commit f78c6c3

File tree

12 files changed

+22
-22
lines changed

12 files changed

+22
-22
lines changed

Diff for: dynamic-inventory/digitalocean/provision.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
wait_for_connection:
3737

3838
- name: Install tcpdump.
39-
yum: name=tcpdump state=present
39+
dnf: name=tcpdump state=present

Diff for: first-ansible-playbook/playbook.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
tasks:
66
- name: Ensure chrony (for time synchronization) is installed.
7-
yum:
7+
dnf:
88
name: chrony
99
state: present
1010

@@ -18,5 +18,5 @@
1818
- hosts: all
1919
become: yes
2020
tasks:
21-
- yum: name=chrony state=present
21+
- dnf: name=chrony state=present
2222
- service: name=chronyd state=started enabled=yes

Diff for: nodejs-role/playbook.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
state: present
1212

1313
- name: Install Remi repo.
14-
yum:
14+
dnf:
1515
name: "https://rpms.remirepo.net/enterprise/remi-release-8.rpm"
1616
state: present
1717

1818
- name: Install EPEL repo.
19-
yum: name=epel-release state=present
19+
dnf: name=epel-release state=present
2020

2121
- name: Ensure firewalld is stopped (since this is a test server).
2222
service: name=firewalld state=stopped

Diff for: nodejs-role/roles/nodejs/tasks/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Install Node.js (npm plus all its dependencies).
3-
yum: name=npm state=present enablerepo=epel
3+
dnf: name=npm state=present enablerepo=epel
44

55
- name: Install forever module (to run our Node.js app).
66
npm: name=forever global=yes state=present

Diff for: nodejs/provisioning/playbook.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77

88
tasks:
99
- name: Install EPEL repo.
10-
yum: name=epel-release state=present
10+
dnf: name=epel-release state=present
1111

1212
- name: Import Remi GPG key.
1313
rpm_key:
1414
key: "https://rpms.remirepo.net/RPM-GPG-KEY-remi2018"
1515
state: present
1616

1717
- name: Install Remi repo.
18-
yum:
18+
dnf:
1919
name: "https://rpms.remirepo.net/enterprise/remi-release-8.rpm"
2020
state: present
2121

2222
- name: Ensure firewalld is stopped (since this is a test server).
2323
service: name=firewalld state=stopped
2424

2525
- name: Install Node.js and npm.
26-
yum: name=npm state=present enablerepo=epel
26+
dnf: name=npm state=present enablerepo=epel
2727

2828
- name: Install Forever (to run our Node.js app).
2929
npm: name=forever global=yes state=present

Diff for: orchestration/scripts/app.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55

66
# Configure Django on app server.
7-
ansible app -b -m yum -a "name=python3-pip state=present"
7+
ansible app -b -m dnf -a "name=python3-pip state=present"
88
ansible app -b -m pip -a "executable=pip3 name=django<4 state=present"
99

1010
# Check Django version.

Diff for: orchestration/scripts/db.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
set -e
55

66
# Configure MySQL (MariaDB) server.
7-
ansible db -b -m yum -a "name=mariadb-server state=present"
7+
ansible db -b -m dnf -a "name=mariadb-server state=present"
88
ansible db -b -m service -a "name=mariadb state=started enabled=yes"
99

1010
# Configure firewalld.
11-
ansible db -b -m yum -a "name=firewalld state=present"
11+
ansible db -b -m dnf -a "name=firewalld state=present"
1212
ansible db -b -m service -a "name=firewalld state=started enabled=yes"
1313
ansible db -b -m firewalld -a "zone=database state=present permanent=yes"
1414
ansible db -b -m firewalld -a "source=192.168.60.0/24 zone=database state=enabled permanent=yes"
1515
ansible db -b -m firewalld -a "port=3306/tcp zone=database state=enabled permanent=yes"
1616

1717
# Configure DB user for Django.
18-
ansible db -b -m yum -a "name=python3-PyMySQL state=present"
18+
ansible db -b -m dnf -a "name=python3-PyMySQL state=present"
1919
ansible db -b -m mysql_user -a "name=django host=% password=12345 priv=*.*:ALL state=present"

Diff for: orchestration/scripts/multi.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
set -e
55

66
# Other commands from the book.
7-
ansible multi -b -m yum -a "name=chrony state=present"
7+
ansible multi -b -m dnf -a "name=chrony state=present"
88
ansible multi -m stat -a "path=/etc/environment"
99
ansible multi -m copy -a "src=/etc/hosts dest=/tmp/hosts"
1010
ansible multi -b -m fetch -a "src=/etc/hosts dest=/tmp"
1111
ansible multi -m file -a "dest=/tmp/test mode=644 state=directory"
1212
ansible multi -m file -a "dest=/tmp/test state=absent"
13-
ansible multi -b -B 3600 -P 0 -a "yum -y update"
13+
ansible multi -b -B 3600 -P 0 -a "dnf -y update"

Diff for: security/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565

6666
# Automating updates for RHEL systems.
6767
- name: Install dnf-automatic.
68-
yum:
68+
dnf:
6969
name: dnf-automatic
7070
state: present
7171

@@ -114,13 +114,13 @@
114114

115115
# Monitor logins and block suspect IP addresses.
116116
- name: Ensure EPEL repo is present.
117-
yum:
117+
dnf:
118118
name: epel-release
119119
state: present
120120
when: ansible_os_family == 'RedHat'
121121

122122
- name: Install fail2ban (RedHat).
123-
yum:
123+
dnf:
124124
name: fail2ban
125125
state: present
126126
enablerepo: epel
@@ -140,7 +140,7 @@
140140

141141
# Use SELinux (Security-Enhanced Linux).
142142
- name: Install Python SELinux library.
143-
yum:
143+
dnf:
144144
name: python3-libselinux
145145
state: present
146146

Diff for: tests/nodejs-role.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
tasks:
55
- name: Install firewalld so we can disable it in the playbook.
6-
yum: name=firewalld state=present
6+
dnf: name=firewalld state=present
77

88
# Node.js role test.
99
- import_playbook: ../nodejs-role/playbook.yml

Diff for: tests/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
tasks:
55
- name: Install firewalld so we can disable it in the playbook.
6-
yum: name=firewalld state=present
6+
dnf: name=firewalld state=present
77

88
# Node.js test.
99
- import_playbook: ../nodejs/provisioning/playbook.yml

Diff for: tests/security.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
tasks:
88
- name: Install test dependencies.
9-
yum:
9+
dnf:
1010
name:
1111
- python3-libselinux
1212
- python3-policycoreutils

0 commit comments

Comments
 (0)