Take another stab at handling new hardware installs.
This commit is contained in:
parent
af0894f472
commit
bef13aee3b
3 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
- import_playbook: "/srv/web/infra/ansible/playbooks/include/happy-birthday.yml myhosts=arm-qa"
|
||||
|
||||
- name: Setup arm-qa hosts
|
||||
hosts: arm-qa
|
||||
|
|
15
playbooks/include/happy_birthday.yml
Normal file
15
playbooks/include/happy_birthday.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
- name: handle ssh keys on a hosts birthday (new hw machine)
|
||||
hosts: "{{ myhosts }}"
|
||||
gather_facts: False
|
||||
|
||||
vars_files:
|
||||
- /srv/web/infra/ansible/vars/global.yml
|
||||
- "/srv/private/ansible/vars.yml"
|
||||
- /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml
|
||||
|
||||
tasks:
|
||||
- import_tasks: "{{ tasks_path }}/happy_birthday.yml"
|
||||
|
||||
handlers:
|
||||
- import_tasks: "{{ handlers_path }}/restart_services.yml"
|
||||
|
7
tasks/happy_birthday.yml
Normal file
7
tasks/happy_birthday.yml
Normal file
|
@ -0,0 +1,7 @@
|
|||
- name: gather ssh host key from new instance
|
||||
local_action: command ssh-keyscan -t rsa {{ inventory_hostname }}
|
||||
ignore_errors: True
|
||||
register: hostkey
|
||||
|
||||
- name: Include basessh
|
||||
include_role: name=basessh
|
Loading…
Add table
Add a link
Reference in a new issue