Added nova compute
Also configured horizon to display hypervisors.
This commit is contained in:
parent
1b7fa48714
commit
d42d1495e9
@ -1,4 +1,8 @@
|
|||||||
---
|
---
|
||||||
|
- hosts: all
|
||||||
|
name: Dummy to gather facts
|
||||||
|
tasks: []
|
||||||
|
|
||||||
- hosts: horizon
|
- hosts: horizon
|
||||||
become: True
|
become: True
|
||||||
roles:
|
roles:
|
||||||
|
5
hosts
5
hosts
@ -11,7 +11,7 @@ openstack01-node01
|
|||||||
openstack01-node02
|
openstack01-node02
|
||||||
|
|
||||||
[horizon]
|
[horizon]
|
||||||
kolla2
|
openstack01-node03
|
||||||
|
|
||||||
[rabbitmq]
|
[rabbitmq]
|
||||||
openstack01-node01
|
openstack01-node01
|
||||||
@ -39,3 +39,6 @@ run_options="-e CASSANDRA_SEEDS=172.23.41.1"
|
|||||||
|
|
||||||
[nova-controller]
|
[nova-controller]
|
||||||
openstack01-node01
|
openstack01-node01
|
||||||
|
|
||||||
|
[nova-compute]
|
||||||
|
openstack01-node04
|
||||||
|
9
nova-compute.yml
Normal file
9
nova-compute.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
name: Dummy to gather facts
|
||||||
|
tasks: []
|
||||||
|
|
||||||
|
- hosts: nova-compute
|
||||||
|
become: True
|
||||||
|
roles:
|
||||||
|
- nova-compute
|
@ -8,8 +8,10 @@ TimeoutStartSec=0
|
|||||||
Restart=always
|
Restart=always
|
||||||
ExecStartPre=-/usr/bin/docker rm -f %n
|
ExecStartPre=-/usr/bin/docker rm -f %n
|
||||||
ExecStart=/usr/bin/docker run --name %n \
|
ExecStart=/usr/bin/docker run --name %n \
|
||||||
-e "MEMCACHED_SERVER={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
|
-e "MEMCACHED_SERVER={{ hostvars[groups['memcached'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||||
-e "OPENSTACK_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
|
-e "KEYSTONE_HOST={{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||||
|
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
|
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
-p 80:80 \
|
-p 80:80 \
|
||||||
hpc/horizon
|
hpc/horizon
|
||||||
|
|
||||||
|
24
roles/nova-compute/tasks/main.yml
Normal file
24
roles/nova-compute/tasks/main.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Build and install a docker image for nova-controller.
|
||||||
|
---
|
||||||
|
- name: install service file.
|
||||||
|
template:
|
||||||
|
src: templates/nova-compute.service
|
||||||
|
dest: /etc/systemd/system/nova-compute.service
|
||||||
|
mode: 644
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
|
||||||
|
- command: systemctl daemon-reload
|
||||||
|
|
||||||
|
- apt:
|
||||||
|
name: '{{ item }}'
|
||||||
|
with_items:
|
||||||
|
- kvm
|
||||||
|
- libvirt0
|
||||||
|
- libvirt-bin
|
||||||
|
- qemu
|
||||||
|
|
||||||
|
- name: make sure service is started
|
||||||
|
systemd:
|
||||||
|
name: nova-compute.service
|
||||||
|
state: restarted
|
35
roles/nova-compute/templates/nova-compute.service
Normal file
35
roles/nova-compute/templates/nova-compute.service
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Openstack nova-compute Container
|
||||||
|
After=docker.service
|
||||||
|
Requires=docker.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
TimeoutStartSec=0
|
||||||
|
Restart=always
|
||||||
|
ExecStartPre=-/usr/bin/docker rm -f %n
|
||||||
|
ExecStart=/usr/bin/docker run --name %n \
|
||||||
|
-e "MY_IP={{ hostvars[groups['nova-compute'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||||
|
-e "NOVA_USER=nova" \
|
||||||
|
-e "NOVA_COMPUTE_USER=nova_compute" \
|
||||||
|
-e "NOVA_PASSWORD=geheim" \
|
||||||
|
-e "NOVA_PLACEMENT_USER=placement" \
|
||||||
|
-e "NOVA_PLACEMENT_PASSWORD=geheim" \
|
||||||
|
-e "RABBIT_USER=openstack" \
|
||||||
|
-e "RABBIT_PASSWORD=geheim" \
|
||||||
|
-e "RABBIT_HOST={{ hostvars[groups['rabbitmq'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||||
|
-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'] }}" \
|
||||||
|
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
|
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
|
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
|
--privileged \
|
||||||
|
-v /var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock \
|
||||||
|
-v /srv/osdisks:/var/lib/nova/instances \
|
||||||
|
hpc/novacompute /etc/run.sh
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
@ -22,7 +22,6 @@ ExecStart=/usr/bin/docker run --name %n \
|
|||||||
-e "NOVA_CONTROLLER_HOST={{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }}" \
|
-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 "GLANCE_CONTROLLER_HOST={{ hostvars[groups['glance-controller'][0]]['ansible_default_ipv4']['address'] }}" \
|
||||||
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
|
--add-host=nova-controller:{{ hostvars[groups['nova-controller'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
--add-host=keystone:{{ hostvars[groups['keystone'][0]]['ansible_default_ipv4']['address'] }} \
|
|
||||||
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
|
--add-host=mariadb:{{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }} \
|
||||||
--privileged \
|
--privileged \
|
||||||
-p 8774:8774 \
|
-p 8774:8774 \
|
||||||
|
Loading…
Reference in New Issue
Block a user