blob: 04a7e8c08683e850a7ad7028ffc4003b577f7822 [file] [log] [blame]
- name: Ensure MAAS Ansible Config Directory
become: yes
file:
path=/etc/maas/ansible
owner=maas
group=maas
state=directory
mode="0755"
- name: Ensure Ansible Roles
become: yes
synchronize:
src: "{{ item }}"
dest: /etc/maas/ansible
with_items:
- roles
- library
- name: Ensure Role Permissions and Modes
become: yes
file:
path: /etc/maas/ansible/roles
owner: maas
group: maas
mode: u=rwX,g=rX,o=rX
state: directory
recurse: true
- name: Ensure Ansible Provisioning Script
become: yes
copy:
dest=/etc/maas/ansible/{{ item }}
src=files/{{ item }}
owner=maas
group=maas
mode="0755"
with_items:
- do-ansible
- do-switch
- name: Ensure Provisioning Log Directory
become: yes
file:
path=/etc/maas/ansible/logs
state=directory
owner=maas
group=maas
mode="0755"
- name: Capture MAAS API Key
become: yes
command: maas-region-admin apikey --username={{ maas.user }}
register: apikey
changed_when: false
- name: Ensure Compute and Switch Node Playbooks
become: yes
template:
src={{ item }}.j2
dest=/etc/maas/ansible/{{ item }}
owner=maas
group=maas
mode="0644"
with_items:
- compute-node.yml
- switch-node.yml
- name: Ensure Compute and Switch Variable Directory
become: yes
file:
path=/etc/maas/ansible/vars
owner=maas
group=maas
mode="0755"
state=directory
- name: Ensure Compute and Switch Node Variables
become: yes
template:
src=templates/compute-node-vars.yml.j2
dest=/etc/maas/ansible/vars/compute-node-vars.yml
owner=maas
group=maas
mode="0644"
- name: Ensure Connect Switch Ansible Playbook
become: yes
copy:
dest=/etc/maas/ansible/{{ item }}
src=files/{{ item }}
owner=maas
group=maas
mode="0644"
with_items:
- connect-switch.yml
- name: Ensure Dynamic Inventory Script
become: yes
template:
src=templates/pod-inventory
dest=/etc/maas/ansible/pod-inventory
owner=maas
group=maas
mode="0755"
- name: Copy CORD Utility Scripts
become: yes
copy:
src=files/commands/{{ item }}
dest=/usr/local/bin/{{ item }}
owner=root
group=root
mode="0755"
with_items:
- cord
- cord-harvest
- cord-prov
- cord-switch
- cord-generate
- cord-registry
- name: Ensure SSH Key Storage
become: yes
file:
path: /etc/maas/.ssh
mode: "0755"
owner: maas
group: maas
state: directory
- name: Copy SSH Key Pair for POD
become: yes
copy:
src: /etc/maas/.ssh/{{item}}
dest: /etc/maas/.ssh/{{item}}
owner: maas
group: maas
mode: "0644"
with_items:
- cord_rsa
- cord_rsa.pub