From b148b04a0b3509f00a3cc36aef965449396b3691 Mon Sep 17 00:00:00 2001 From: Egon Rijpkema Date: Mon, 28 Aug 2017 11:50:27 +0200 Subject: [PATCH] added post install settings --- post-install.yml | 26 ++++++++++++++++++++++++++ settings.yml | 12 ++++++++++++ site.yml | 1 + 3 files changed, 39 insertions(+) create mode 100644 post-install.yml create mode 100644 settings.yml diff --git a/post-install.yml b/post-install.yml new file mode 100644 index 0000000..3fb6a30 --- /dev/null +++ b/post-install.yml @@ -0,0 +1,26 @@ +--- +- hosts: all + name: Dummy to gather facts + tasks: [] + +- hosts: keystone + become: True + vars_files: + - settings.yml + tasks: + - name: copy public key + copy: + content: "{{ rsa_pub }}" + dest: /srv/keystone/root/id_rsa.pub + - name: post install configuration + command: docker exec -i keystone.service bash -c "source /root/admin-openrc.sh && {{ item }}" + with_items: + - openstack network create --share --external --provider-physical-network provider --provider-network-type flat provider + - > + openstack subnet create --network provider + --allocation-pool start={{ allocation_pool['start'] }},end={{ allocation_pool['end'] }} + --dns-nameserver {{ dns_nameserver }} --gateway {{ gateway }} --subnet-range {{ subnet_range }} provider + - openstack flavor create --id 0 --vcpus 1 --ram 64 --disk 1 m1.nano + - openstack keypair create --public-key /root/id_rsa.pub adminkey + + diff --git a/settings.yml b/settings.yml new file mode 100644 index 0000000..adc7b3c --- /dev/null +++ b/settings.yml @@ -0,0 +1,12 @@ +--- +- allocation_pool: + start: 172.23.128.50 + end: 172.23.128.249 + +- dns_nameserver: 129.125.4.6 + +- gateway: 172.23.128.250 + +- subnet_range: 172.23.128.0/24 + +- rsa_pub: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDStPUPXkcu81onUm/le54JCu174yXJJDsthDr96Mv8irBVBWuy5FxnaASuDpmC4QE4s0UAIg1iq/SWrr8qdBQ4OVuYFiW0S7ZJvcoKr/40Wh+T5MeltGQfmkDp6kBsfaMSo6M4tF1c8i+XgOgxb4fxHYb8mFhseztRLx6McxJJJLB0nu+T12WQ01nl0XtwD+3EsZWfxRH0KA59VHZSe3Anc5z+Fm7WU+1Vzy6/pkiIhVReI1L6VVhZsIdSu3fQK6fHQcujtfuw6RKEpisZQqnxMUviWQ98yeQXHk6Nx840WCh3vvKveEAoC4Y/UEZa1TMe6PczfUaLjaidUkpulJsP egon@egon-pc diff --git a/site.yml b/site.yml index e4a490d..65e6024 100644 --- a/site.yml +++ b/site.yml @@ -9,3 +9,4 @@ - include: neutron-controller.yml - include: nova-compute.yml - include: horizon.yml +- include: post-install.yml