Take another stab at handling new hardware installs.

This commit is contained in:
Kevin Fenzi 2017-12-07 01:30:02 +00:00
parent af0894f472
commit bef13aee3b
3 changed files with 23 additions and 0 deletions

View file

@ -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

View 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
View 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