Created
February 25, 2016 14:56
-
-
Save banyek/fb551e276c2c8ee88ada to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: "{{ host_to_rebuild }}" | |
gather_facts: False | |
user: root | |
serial: 1 | |
tasks: | |
- name: Set PXE boot | |
shell: ipmitool chassis bootdev pxe | |
- name: Reset host | |
shell: service ipmitool power reset | |
- hosts: "admin_host" | |
gather_facts: False | |
user: root | |
serial: 1 | |
tasks: | |
- name: Clearing the known hosts for jenkins | |
shell: echo -n > /usr/share/tomcat/.ssh/known_hosts | |
- name: Clean the puppet cert | |
shell: puppet cert clean {{ host_to_rebuild }}.kinja-ops.com' | |
- name: Sleep for 240 seconds so server can pxe boot | |
action: command /bin/sleep 240 | |
- name: Waiting for port 22 to become available | |
shell: 'while ! nc -v {{ host_to_rebuild }}.kinja-ops.com 22; do /bin/sleep 10; done' | |
- hosts: "{{ host_to_rebuild }}" | |
gather_facts: False | |
user: root | |
serial: 1 | |
- name: run puppet | |
shell: 'ssh -o StrictHostKeyChecking=no root@{{ server }}.{{ datacenter }}.kinja-ops.com puppet agent -tv >> /var/log/messages"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment