From 4e5c496862bec4c482147ccb6b15c04fa2d3209f Mon Sep 17 00:00:00 2001 From: Egon Rijpkema Date: Mon, 16 Apr 2018 17:07:17 +0200 Subject: [PATCH 1/2] Added configure_networks bool and mtu_size var --- post-install.yml | 17 +++++++++++++++-- settings.yml | 13 ++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/post-install.yml b/post-install.yml index cf002dc..457c02d 100644 --- a/post-install.yml +++ b/post-install.yml @@ -20,7 +20,20 @@ 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 }} providersub + when: "{{ configure_networks }}" == True + + +- 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 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 index adc7b3c..c7561d4 100644 --- a/settings.yml +++ b/settings.yml @@ -1,4 +1,7 @@ --- + +- configure_networks: "True" +# Allocation pool for a flat provider network. - allocation_pool: start: 172.23.128.50 end: 172.23.128.249 @@ -9,4 +12,12 @@ - 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 +- global_physnet_mtu: 9000 + +- rsa_pub: > + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDStPUPXkcu81onUm/le54JCu174yXJJDsthDr9 + 6Mv8irBVBWuy5FxnaASuDpmC4QE4s0UAIg1iq/SWrr8qdBQ4OVuYFiW0S7ZJvcoKr/40Wh+T5Mel + tGQfmkDp6kBsfaMSo6M4tF1c8i+XgOgxb4fxHYb8mFhseztRLx6McxJJJLB0nu+T12WQ01nl0Xtw + D+3EsZWfxRH0KA59VHZSe3Anc5z+Fm7WU+1Vzy6/pkiIhVReI1L6VVhZsIdSu3fQK6fHQcujtfuw + 6RKEpisZQqnxMUviWQ98yeQXHk6Nx840WCh3vvKveEAoC4Y/UEZa1TMe6PczfUaLjaidUkpulJsP + egon@egon-pc From 99112894be7b18eedc3e0da9df61fb76b0456440 Mon Sep 17 00:00:00 2001 From: Egon Rijpkema Date: Wed, 18 Apr 2018 10:46:42 +0200 Subject: [PATCH 2/2] Added mtu size variable --- neutron-controller.yml | 4 +++- nova-compute.yml | 4 +++- roles/neutron-controller/tasks/main.yml | 1 + roles/nova-compute/templates/nova-compute.service | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/neutron-controller.yml b/neutron-controller.yml index 8ce60b7..cf03466 100644 --- a/neutron-controller.yml +++ b/neutron-controller.yml @@ -5,5 +5,7 @@ - hosts: neutron-controller become: True + vars_files: + - settings.yml roles: - - neutron-controller + - neutron-controller diff --git a/nova-compute.yml b/nova-compute.yml index 69487e2..088f9e8 100644 --- a/nova-compute.yml +++ b/nova-compute.yml @@ -5,5 +5,7 @@ - hosts: nova-compute become: True + vars_files: + - settings.yml roles: - - nova-compute + - nova-compute diff --git a/roles/neutron-controller/tasks/main.yml b/roles/neutron-controller/tasks/main.yml index b14e101..a269e92 100644 --- a/roles/neutron-controller/tasks/main.yml +++ b/roles/neutron-controller/tasks/main.yml @@ -16,6 +16,7 @@ - set_fact: env_vars: > + -e "GLOBAL_PHYSNET_MTU={{ global_physnet_mtu }}" -e "KEYSTONE_HOST={{ listen_ip | default(hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address']) }}" -e "MEMCACHED_HOST={{ listen_ip | default(hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address']) }}" -e "METADATA_SECRET={{ secrets['METADATA_SECRET'] }}" diff --git a/roles/nova-compute/templates/nova-compute.service b/roles/nova-compute/templates/nova-compute.service index 7ae08b9..40555a1 100644 --- a/roles/nova-compute/templates/nova-compute.service +++ b/roles/nova-compute/templates/nova-compute.service @@ -10,6 +10,8 @@ ExecStartPre=-/usr/bin/docker kill %n ExecStartPre=-/usr/bin/docker rm %n ExecStart=/usr/bin/docker run --name %n \ -e "GLANCE_CONTROLLER_HOST={{ hostvars[groups['glance-controller'][0]]['listen_ip'] | default(hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address']) }}" \ + -e "GLOBAL_PHYSNET_MTU={{ global_physnet_mtu }}" \ + -e "GLOBAL_PHYSNET_MTU={{ global_physnet_mtu }}" \ -e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['listen_ip'] | default(hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address']) }}" \ -e "METADATA_SECRET={{ secrets['METADATA_SECRET'] }}" \ -e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['listen_ip'] | default(hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address']) }}" \