Advertisement
D0cEvil

Ansible - System Update test script

Sep 19th, 2022
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.51 KB | Software | 0 0
  1. - hosts: testserver
  2.   tasks:
  3.  
  4.   - name: System update
  5.     yum: name=* state=latest
  6.  
  7.   - name: Reboot server
  8.     shell: sleep 2 && /sbin/shutdown -r now "Ansible system reboot"
  9.     async: 1
  10.     poll: 0
  11.    
  12.   - name: Wait for host sshd
  13.     local_action: wait_for host={{ inventory_hostname }} port=22 delay=20 connect_timeout=200
  14.     become: false
  15.     delegate_to: localhost
  16.    
  17.  - name: Install epel-release
  18.    yum: name=epel-release state=latest
  19.    
  20.  - name: Install Midnight commander
  21.    yum: name=mc state=latest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement