~~~~~~~~~~~~
- Ansible: tested on 2.9.9 (using Python 3.5.2)
+ - Collections
+ - community.crypto: tested on 1.3.0
+ - ansible.posix: tested on 1.1.1
+ - Roles
+ - geerlingguy.ansible: tested on 2.1.0
- openstacksdk_: tested on 0.46.0 (using Python 3.5.2)
.. _openstacksdk: https://pypi.org/project/openstacksdk
~~~~~~~~~~~~
- Ansible: tested on 2.9.9 (using Python 3.5.2)
+ - Collections
+ - community.crypto: tested on 1.3.0
+ - ansible.posix: tested on 1.1.1
+ - Roles
+ - geerlingguy.ansible: tested on 2.1.0
- openstacksdk_: tested on 0.46.0 (using Python 3.5.2)
.. _openstacksdk: https://pypi.org/project/openstacksdk
operator_key: "{{ hostvars['operator0']['key']['public_key'] }}"
- name: Create cluster operator access information
hosts: "operator0"
- gather_facts: False
+ roles:
+ - role: geerlingguy.ansible
+ become: yes
tasks:
- name: Add cluster hostnames to /etc/hosts file
lineinfile:
line: "{{ item.value + ' ' + item.key }}"
become: yes
loop: "{{ lookup('dict', hostvars['localhost']['hosts_dict']) }}"
+ - name: Create inventory for in-cluster deployment stage
+ template:
+ src: templates/inventory.ini.j2
+ dest: "{{ operation.inventory }}"
+ vars:
+ hosts: "{{ lookup('dict', hostvars['localhost']['hosts_dict']) }}"
operation:
name: "operation0"
+ inventory: "~/inventory.ini"
hosts:
- name: "operator0"
image: *image_name
operation:
name: "operation0"
+ inventory: "~/inventory.ini"
hosts:
- name: "operator0"
image: *image_name
--- /dev/null
+[all]
+{% for item in hosts %}
+{{ item.key }} ansible_host={{ item.value }}
+{% endfor %}
+
+[all:vars]
+ansible_ssh_private_key_file="~/.ssh/{{ keypair.name }}"
+ansible_ssh_common_args='-o StrictHostKeyChecking=no'