Moved env vars to a single variable.
This commit is contained in:
parent
741ba512bc
commit
8300652079
@ -1,5 +1,25 @@
|
||||
# Build and install a docker image for nova-controller.
|
||||
---
|
||||
- set_fact:
|
||||
env_vars: >
|
||||
-e "MY_IP={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "NOVA_USER=nova"
|
||||
-e "NOVA_PASSWORD=geheim"
|
||||
-e "NOVA_PLACEMENT_USER=placement"
|
||||
-e "NOVA_PLACEMENT_PASSWORD=geheim"
|
||||
-e "RABBIT_USER=openstack"
|
||||
-e "RABBIT_PASSWORD=geheim"
|
||||
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "NEUTRON_CONTROLLER_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "MYSQL_ROOT_PASSWORD=geheim"
|
||||
-e "NOVA_CONTROLLER_HOST=={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "GLANCE_CONTROLLER_HOST=={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "NEUTRON_PASSWORD=geheim"
|
||||
-e "NEUTRON_USER=neutron"
|
||||
-e "METADATA_SECRET=geheim"
|
||||
|
||||
- name: install service file.
|
||||
template:
|
||||
src: templates/nova-controller.service
|
||||
@ -13,19 +33,7 @@
|
||||
- name: Initialize database.
|
||||
command: >
|
||||
/usr/bin/docker run --rm
|
||||
-e "MY_IP={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "NOVA_USER=nova"
|
||||
-e "NOVA_PASSWORD=geheim"
|
||||
-e "NOVA_PLACEMENT_USER=placement"
|
||||
-e "NOVA_PLACEMENT_PASSWORD=geheim"
|
||||
-e "RABBIT_USER=openstack"
|
||||
-e "RABBIT_PASSWORD=geheim"
|
||||
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "MYSQL_ROOT_PASSWORD=geheim"
|
||||
-e "NOVA_CONTROLLER_HOST=={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
-e "GLANCE_CONTROLLER_HOST=={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}"
|
||||
{{ env_vars }}
|
||||
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
|
||||
hpc/novacontroller
|
||||
/etc/bootstrap.sh
|
||||
|
@ -8,19 +8,7 @@ TimeoutStartSec=0
|
||||
Restart=always
|
||||
ExecStartPre=-/usr/bin/docker rm -f %n
|
||||
ExecStart=/usr/bin/docker run --name %n \
|
||||
-e "MY_IP={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||
-e "NOVA_USER=nova" \
|
||||
-e "NOVA_PASSWORD=geheim" \
|
||||
-e "NOVA_PLACEMENT_USER=placement" \
|
||||
-e "NOVA_PLACEMENT_PASSWORD=geheim" \
|
||||
-e "RABBIT_USER=openstack" \
|
||||
-e "RABBIT_PASSWORD=geheim" \
|
||||
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||
-e "MEMCACHED_HOST={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||
-e "MYSQL_HOST={{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||
-e "MYSQL_ROOT_PASSWORD=geheim" \
|
||||
-e "NOVA_CONTROLLER_HOST={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||
-e "GLANCE_CONTROLLER_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||
{{ env_vars | replace('\n', '') }} \
|
||||
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
|
||||
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
|
||||
--privileged \
|
||||
|
Loading…
Reference in New Issue
Block a user