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
7 months agoRasheeda
8 months agoJerry
8 months agoRaelene
8 months agoFiliberto
8 months agoEden
9 months agoEstrella
9 months agoMarisha
9 months agoJarod
9 months agoShanda
9 months agoJosphine
9 months agoSabine
9 months agoJustine
9 months agoLawrence
9 months agoYvonne
9 months agoGregoria
9 months agoLatanya
10 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