diff --git a/playbooks/groups/arm-qa.yml b/playbooks/groups/arm-qa.yml index 9d69482de5..e056affcaf 100644 --- a/playbooks/groups/arm-qa.yml +++ b/playbooks/groups/arm-qa.yml @@ -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 diff --git a/playbooks/include/happy_birthday.yml b/playbooks/include/happy_birthday.yml new file mode 100644 index 0000000000..f9ba7e6e07 --- /dev/null +++ b/playbooks/include/happy_birthday.yml @@ -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" + diff --git a/tasks/happy_birthday.yml b/tasks/happy_birthday.yml new file mode 100644 index 0000000000..362c90464e --- /dev/null +++ b/tasks/happy_birthday.yml @@ -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