Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Set the hostname
- - name: Set the hostname
- hostname: name={{ inventory_hostname }}
- become: true
- # Populate /etc/hosts with critical hosts
- - name: Populate /etc/hosts
- template: src=hosts.j2 dest=/etc/hosts
- become: true
- # Set /etc/resolv.conf to use a known good nameserver
- - name: Set /etc/resolv.conf to use 8.8.8.8 for initial updates
- copy: src=resolv.conf dest=/etc/resolv.conf owner=root group=root mode=0644
- become: true
- # Register the systems with RedHat
- - include: redhat.yaml
- tags:
- - redhat
- # For sanity's sake, flush all handlers queued -- including reboot -- and
- # wait for hosts to come back up.
- - meta: flush_handlers
- - name: Wait for node to reboot
- local_action: wait_for
- host={{ inventory_hostname }}
- state=started
- delay=30
- timeout=300
- ***** redhat.yaml *****
- - name: Register with Red Hat Enterprise Linux Developer Suite
- redhat_subscription: state=present username={{ redhat_username }}
- password={{ redhat_password }}
- pool='Red Hat Enterprise Linux Developer Suite'
- become: true
- - name: Update all software
- yum: name=* state=latest
- become: true
- notify: Restart the node
- ***** handlers/main.yaml *****
- - name: Restart the node
- shell: sleep 2 && systemctl reboot
- async: 1
- poll: 0
- become: true
- ignore_errors: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement