- hosts: all vars: nodepool_config_dir: "/etc/nodepool" nodepool_log_dir: "/var/log/nodepool" NODEPOOL_KEY: "$HOME/.ssh/id_nodepool" NODEPOOL_KEY_NAME: "root" NODEPOOL_PUBKEY: "$HOME/.ssh/id_nodepool.pub" NODEPOOL_INSTALL: "$HOME/nodepool-venv" NODEPOOL_CACHE_GET_PIP: "/opt/stack/cache/files/get-pip.py" NODEPOOL_CONFIG: "{{ nodepool_config_dir }}/nodepool.yaml" NODEPOOL_DIB_BASE_PATH: "/opt/dib" tasks: - name: Write clouds.yaml include_tasks: write_clouds_yaml.yaml - name: Create nodepool flavors args: executable: /bin/bash shell: | openstack --os-cloud=devstack-admin flavor create --ram=512 --disk=5 --vcpus=1 --id=64 nodepool-512 openstack --os-cloud=devstack-admin flavor create --ram=1024 --disk=5 --vcpus=1 --id=128 nodepool-1024 - name: Create security groups args: executable: /bin/bash shell: | openstack --os-cloud=devstack security group rule create --ingress --protocol tcp --dst-port 1:65535 --remote-ip 0.0.0.0/0 default openstack --os-cloud=devstack security group rule create --ingress --protocol udp --dst-port 1:65535 --remote-ip 0.0.0.0/0 default - name: Create unmanaged VM args: executable: /bin/bash shell: | openstack --os-cloud=devstack-admin network list cirros_image=$(openstack --os-cloud=devstack image list -f value -c Name | grep cirros | head -n1) openstack --os-cloud=devstack server create --flavor=cirros256 --image="$cirros_image" --network=public unmanaged-vm - name: Create nodepool SSH keypair args: executable: /bin/bash shell: | ssh-keygen -f {{ NODEPOOL_KEY }} -P "" openstack --os-cloud=devstack keypair create --public-key="{{ NODEPOOL_PUBKEY }}" "{{ NODEPOOL_KEY_NAME }}" - name: Write nodepool elements args: executable: /bin/bash shell: cmd: | sudo mkdir -p $(dirname {{ NODEPOOL_CONFIG }})/elements/nodepool-setup/install.d sudo mkdir -p $(dirname {{ NODEPOOL_CONFIG }})/elements/nodepool-setup/root.d cat > /tmp/40-nodepool-setup < /tmp/50-apt-allow-unauthenticated <