Ansible Playbook - Installing Packages - Red Hat Certified Engineer Ex294
Install packages
create a playbook called packages.yml that:
installs the httpd on hosts in host_2 host group
installs the RPM Development tools package group on host in the host_1 host group
update all packages to the latest version on host in host_1 host group
---
name: install and run httpd in host_2
hosts: host_2
tasks:
name: install httpd
yum:
name: httpd
state: latest
name: start httpd servise
service:
name: httpd
state: started
enabled: true
name: work on host_1
hosts: host_1
tasks:
- name: developer tools
yum:
name: "@Development tools"
state: present
name: latest
yum:
name: '*'
state: latest