RedHat EX294 Exam - Topic 2 Question 40 Discussion
Create a playbook called packages.yml that:------------------------------------------------> Installs the php and mariadb packages on hosts in the dev, test, and prod hostgroups.--> Installs the Development Tools package group on hosts in the dev host group.--> Updates all packages to the latest version on hosts in the dev host group.
A) Explanation:
Solution as:
# pwd
home/admin/ansible/
# vim packages.yml
---
- name: Install the packages
hosts: dev,test,prod
vars:
- php_pkg: php
- mariadb_pkg: mariadb
tasks:
- name: install the packages
yum:
name:
- '{{ php_pkg }}'
- '{{ mariadb_pkg }}'
state: latest
- name: install the devops tool packages
hosts: dev
tasks:
- name: install devepment tools
yum:
name: '@Development Tools'
state: latest
- name: upgrade all the packages
yum:
name: '*'
state: latest
exclude: kernel*
!wq
# ansible-playbook package.yml ---syntax-check
# ansible-playbook package.yml
Jame
9 months agoRasheeda
10 months agoJerry
10 months agoRaelene
10 months agoFiliberto
10 months agoEden
11 months agoEstrella
11 months agoMarisha
11 months agoJarod
11 months agoShanda
11 months agoJosphine
11 months agoSabine
11 months agoJustine
11 months agoLawrence
11 months agoYvonne
11 months agoGregoria
11 months agoLatanya
12 months agoJunita
2 years agoPaul
2 years agoAlpha
2 years agoJunita
2 years agoPaul
2 years agoAlpha
2 years agoLorrine
2 years agoHana
2 years agoMuriel
2 years agoLorrine
2 years agoHana
2 years agoMuriel
2 years ago