

name: Play 3 - Install updates for all workstations except david # Play 3 - Do all workstations except david The names for these hosts are contained in the group of the /etc/ansible/hosts inventory file. This play updates all of the remaining hosts on my network. The third playĪnd here is the third play. The default timeout for this is 10 minutes, after which Ansible throws an error.

The critical feature of the Ansible reboot function is that it performs a verification that the reboot has been successful, the remote host is up and running, and SSH communication is once again working. Reboot: Ansible has a built-in reboot capability, so that we can use that in this play instead of the Linux poweroff command. It does not matter which sequence these two hosts are updated so long as they are not both done simultaneously. In this case, I need wally, the firewall, to be up and running so that the yorktown server has access to the Internet to download the updated packages. If the all_servers group in the inventory contained ten servers, I could use a higher limit, such as two, so that this play would be run against two servers at a time. Serial: This additional statement tells Ansible to run this play on one host at a time, that is, serially rather than in parallel. This entire second play is almost the same as the first, except for two lines. When: (check.stdout | regex_search('reboot will be required')) and reboot = "true" and run = "true"

name: Reboot if necessary and reboot extra variable is true When: (check.stdout | regex_search('updates ARE available')) and run = "true" name: Check for currently available updates Src: /root/ansible/Updates/files/doUpdates name: Install the latest version of the doUpdates script name: Play 2 - Install updates for servers yorktown and wally The names for these two hosts are contained in the group in the /etc/ansible/hosts inventory file.

To accomplish that, this play updates those two hosts one at a time. The server needs to run while the firewall and other hosts are being updated to provide DHCP and name services. The firewall needs to be up and running while the servers-and all other hosts-are being updated so they can have Internet access to download the update packages. The purpose of this play is to perform updates on the firewall and server. Let's begin this second article by examining the second play. Automate Red Hat Enterprise Linux with Ansible and Satellite.Ansible Automation Platform trial subscription.A system administrator's guide to IT automation.Ansible Automation Platform beginner's guide.
