2 - name: Prepare infrastructure and create operation instances
11 hosts: "{{ operation.hosts }}"
13 - name: Create cluster operator access keypair
17 - name: Wait for system to become reachable
19 - name: Generate an OpenSSH keypair with the default values (4096 bits, rsa)
20 community.crypto.openssh_keypair:
21 path: "~/.ssh/{{ keypair.name }}"
23 - name: Add operator0 public key to it's authorized keys
25 key: "{{ key['public_key'] }}"
27 user: "{{ ansible_user }}"
28 - name: Create cluster instances
34 hosts: "{{ cluster.hosts }}"
35 operator_key: "{{ hostvars['operator0']['key']['public_key'] }}"
36 - name: Create cluster operator access information
39 - role: geerlingguy.ansible
42 - name: Add cluster hostnames to /etc/hosts file
45 line: "{{ item.value + ' ' + item.key }}"
47 loop: "{{ lookup('dict', hostvars['localhost']['hosts_dict']) }}"
48 - name: Create inventory for in-cluster deployment stage
50 src: templates/inventory.ini.j2
51 dest: "{{ operation.inventory }}"
53 hosts: "{{ lookup('dict', hostvars['localhost']['hosts_dict']) }}"
54 - name: Push in-cluster deployment stage description to the next Ansible control host
55 ansible.posix.synchronize:
56 src: ../../cluster-rke
58 - name: Install python dependencies
65 - name: Install community.kubernetes.k8s Ansible collection dependencies
73 - name: Add Ansible collection dependencies
74 command: "ansible-galaxy collection install ansible.posix"
75 - name: Add community.kubernetes Ansible collection
76 command: "ansible-galaxy collection install community.kubernetes"