kayobe/ansible/kayobe-ansible-user.yml
Mark Goddard 27db155c0e Add support for monitoring nodes
Currently these nodes are not deployed using kolla-ansible but use the
host provisioning and host OS configuration pieces of kayobe. The
monasca-deploy project is used to deploy the monitoring services.
2017-05-29 16:52:17 +01:00

31 lines
1010 B
YAML

---
- name: Ensure the Kayobe Ansible user account exists
hosts: seed:overcloud
vars:
ansible_user: "{{ bootstrap_user }}"
tasks:
- block:
- name: Ensure the Kayobe Ansible group exists
group:
name: "{{ kayobe_ansible_user }}"
state: present
- name: Ensure the Kayobe Ansible user account exists
user:
name: "{{ kayobe_ansible_user }}"
group: "{{ kayobe_ansible_user }}"
comment: "Kayobe Ansible SSH access"
state: present
- name: Ensure the Kayobe Ansible user has passwordless sudo
copy:
content: "{{ kayobe_ansible_user }} ALL=(ALL) NOPASSWD: ALL"
dest: "/etc/sudoers.d/kayobe-ansible-user"
mode: 0440
- name: Ensure the Kayobe Ansible user has authorized our SSH key
authorized_key:
user: "{{ kayobe_ansible_user }}"
key: "{{ lookup('file', ssh_public_key_path) }}"
become: True