Skip to content

Commit 126889e

Browse files
committed
replace yum with DNF
1 parent a7ea01a commit 126889e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

slides/ansible-techlab/puzzle-demo.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ pull (Puppet way) vs push (ansible way) --> push braucht weder daemon noch sonst
381381

382382
## Why Ansible?
383383

384-
- Simple setup (yum install ansible)
384+
- Simple setup (dnf install ansible)
385385
- Agentless
386386
- Standard transport (ssh)
387387
- Easy (relatively), yaml
@@ -598,13 +598,13 @@ provisioning: local
598598
### Indentation
599599
wrong:
600600
```yaml
601-
- ansible.builtin.yum:
601+
- ansible.builtin.dnf:
602602
name: httpd
603603
state: installed
604604
```
605605
right:
606606
```yaml
607-
- ansible.builtin.yum:
607+
- ansible.builtin.dnf:
608608
name: httpd
609609
state: installed
610610
```
@@ -692,7 +692,7 @@ ansible.builtin.setup → get «facts»
692692
***
693693
## Ad hoc commands
694694
Examples:
695-
- `ansible all -b -m ansible.builtin.yum -a "name=httpd state=present"`
695+
- `ansible all -b -m ansible.builtin.dnf -a "name=httpd state=present"`
696696
- `ansible all -b -m ansible.builtin.service -a "name=httpd state=started"`
697697
- `ansible all -a "uptime"`
698698

@@ -757,7 +757,7 @@ Very simple example:
757757
- hosts: web
758758
tasks:
759759
- name: install httpd
760-
ansible.builtin.yum:
760+
ansible.builtin.dnf:
761761
name: httpd
762762
state: installed
763763
```
@@ -778,7 +778,7 @@ same as before:
778778
- hosts: web
779779
tasks:
780780
- name: install httpd
781-
yum: name=httpd state=installed
781+
dnf: name=httpd state=installed
782782
```
783783

784784
Not Best Practice!
@@ -797,7 +797,7 @@ A bit more complex:
797797
become: true
798798
tasks:
799799
- name: install mariadb
800-
ansible.builtin.yum:
800+
ansible.builtin.dnf:
801801
name: mariadb
802802
state: installed
803803
- name: start mariadb
@@ -848,7 +848,7 @@ defined in playbook:
848848
my_package: nginx
849849
tasks:
850850
- name: install nginx
851-
ansible.builtin.yum:
851+
ansible.builtin.dnf:
852852
name: "{{ my_package }}"
853853
state: installed
854854
```
@@ -1005,12 +1005,12 @@ Example:
10051005
become: true
10061006
tasks:
10071007
- name: Install ntp
1008-
ansible.builtin.yum:
1008+
ansible.builtin.dnf:
10091009
name: ntp
10101010
state: present
10111011
tags: ntp
10121012
- name: Install figlet
1013-
ansible.builtin.yum:
1013+
ansible.builtin.dnf:
10141014
name: figlet
10151015
state: present
10161016
tags: figlet
@@ -1084,7 +1084,7 @@ Nicht nur in Templates sind `when` Conditions möglich
10841084
- no local config used
10851085
- git repo mandatory
10861086
- no stuff stored locally
1087-
- yum install ansible → ansible-pull
1087+
- dnf install ansible → ansible-pull
10881088
<!-- .slide: class="master-content" > -->
10891089

10901090
***
@@ -1128,14 +1128,14 @@ Mit Task Kontrolle kann man definieren, wie Ansible auf die Nodes zugreift.
11281128
Ad-Hoc command:
11291129

11301130
```bash
1131-
ansible node1 -i hosts -B 10 -P 2 -m ansible.builtin.yum -a "name=my_package state=present"
1131+
ansible node1 -i hosts -B 10 -P 2 -m ansible.builtin.dnf -a "name=my_package state=present"
11321132
```
11331133

11341134
Task:
11351135

11361136
```yaml
11371137
- name: fire and forget
1138-
ansible.builtin.yum:
1138+
ansible.builtin.dnf:
11391139
name: my_package
11401140
state: installed
11411141
async: 60 #← needed as well
@@ -1281,7 +1281,7 @@ Example (no roles yet):
12811281
- hosts: web
12821282
become: true
12831283
tasks:
1284-
- ansible.builtin.yum:
1284+
- ansible.builtin.dnf:
12851285
name: httpd
12861286
state: installed
12871287
- service:

0 commit comments

Comments
 (0)