59 lines
2.2 KiB
YAML
59 lines
2.2 KiB
YAML
---
|
|
- hosts: seed[0]
|
|
vars:
|
|
openstack_auth:
|
|
auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
|
|
username: "{{ lookup('env', 'OS_USERNAME') }}"
|
|
password: "{{ lookup('env', 'OS_PASSWORD') }}"
|
|
project_name: "{{ lookup('env', 'OS_PROJECT_NAME') }}"
|
|
project_domain_name: "{{ lookup('env', 'OS_PROJECT_DOMAIN_NAME') }}"
|
|
user_domain_name: "{{ lookup('env', 'OS_USER_DOMAIN_NAME') }}"
|
|
image_download_dir: "{{ ansible_user_dir }}/images"
|
|
tasks:
|
|
- name: Ensure OpenStack shade module is installed
|
|
pip:
|
|
name: shade
|
|
become: True
|
|
|
|
- name: Ensure image download directory exists
|
|
file:
|
|
path: "{{ image_download_dir }}"
|
|
state: directory
|
|
|
|
- name: Ensure Ironic CoreOS IPA deploy images are downloaded
|
|
unarchive:
|
|
src: http://tarballs.openstack.org/ironic-python-agent/coreos/ipa-coreos-stable-newton.tar.gz
|
|
dest: "{{ image_download_dir }}"
|
|
remote_src: yes
|
|
|
|
- name: Ensure Ironic CoreOS IPA deploy images are registered with Glance
|
|
os_image:
|
|
auth: "{{ openstack_auth }}"
|
|
name: "{{ item.name }}"
|
|
container_format: "{{ item.format }}"
|
|
disk_format: "{{ item.format }}"
|
|
state: present
|
|
filename: "{{ image_download_dir }}/imagebuild/coreos/UPLOAD/{{ item.filename }}"
|
|
with_items:
|
|
- { name: ipa.initrd, filename: coreos_production_pxe_image-oem-stable-newton.cpio.gz, format: ari }
|
|
- { name: ipa.vmlinuz, filename: coreos_production_pxe-stable-newton.vmlinuz, format: aki }
|
|
|
|
- name: Ensure provisioning network is registered with Neutron
|
|
os_network:
|
|
auth: "{{ openstack_auth }}"
|
|
name: provision-net
|
|
provider_network_type: flat
|
|
provider_physical_network: physnet1
|
|
shared: True
|
|
state: present
|
|
|
|
- name: Ensure provisioning subnet is registered with Neutron
|
|
os_subnet:
|
|
auth: "{{ openstack_auth }}"
|
|
name: provision-subnet
|
|
network_name: provision-net
|
|
cidr: "{{ provision_net_cidr }}"
|
|
allocation_pool_start: "{{ provision_net_allocation_pool_start | default(omit) }}"
|
|
allocation_pool_end: "{{ provision_net_allocation_pool_end | default(omit) }}"
|
|
state: present
|