From 5a81413b3af6cab2abc0c1c28a094be41f8b5844 Mon Sep 17 00:00:00 2001 From: Egon Rijpkema Date: Tue, 16 May 2017 15:52:22 +0200 Subject: [PATCH] Added rabbitMQ and keystone with wim Work in progress... --- hosts | 5 +++++ main.yml | 16 ++-------------- roles/common/secrets/password_list.yml | 22 ++++++++++++++++++++++ roles/common/tasks/main.yml | 3 +++ roles/keystone/files/keystone.conf | 8 ++++++++ roles/rabbitmq/files/rabbitmq.service | 18 ++++++++++++++++++ roles/rabbitmq/tasks/main.yml | 16 ++++++++++++++++ 7 files changed, 74 insertions(+), 14 deletions(-) create mode 100644 roles/common/secrets/password_list.yml create mode 100644 roles/keystone/files/keystone.conf create mode 100644 roles/rabbitmq/files/rabbitmq.service create mode 100644 roles/rabbitmq/tasks/main.yml diff --git a/hosts b/hosts index c5b3dfe..c011442 100644 --- a/hosts +++ b/hosts @@ -4,6 +4,11 @@ ansible-test ansible-test [registry] ansible-test +[rabbitmq] +ansible-test-mq + + + diff --git a/main.yml b/main.yml index 5c2d14b..a39178c 100644 --- a/main.yml +++ b/main.yml @@ -1,19 +1,7 @@ --- # Run all plays as root. -- hosts: databases - become: True - roles: - - common - - mariadb - -- hosts: keystone - become: True - roles: - - common - - keystone - -- hosts: registry +- hosts: rabbitmq become: True roles: - common - - dockerregistry + - rabbitmq diff --git a/roles/common/secrets/password_list.yml b/roles/common/secrets/password_list.yml new file mode 100644 index 0000000..85d33c6 --- /dev/null +++ b/roles/common/secrets/password_list.yml @@ -0,0 +1,22 @@ +--- +- secrets: + ADMIN_PASS: fb5DFGHAYwMcaSLx + CEILOMETER_DBPASS: v3nabCeUsRFeuYwr + CEILOMETER_PASS: 6dqTJVKM92FYppZB + CINDER_DBPASS: oggtkqvYrvZRhIX0 + CINDER_PASS: UvelZF7LDmWCiZrj + DASH_DBPASS: tOuBncSCirVOFV9i + DEMO_PASS: wq2EXzynUq0uTe23 + GLANCE_DBPASS: CvnMdwW5yVjnoRKo + GLANCE_PASS: anR4RA0f1urYuw2l + HEAT_DBPASS: nyUjDRR4ZSFLDyWt + HEAT_DOMAIN_PASS: AwHABN5taTG6ayS7 + HEAT_PASS: vDs7hbAl0VzXIfnh + KEYSTONE_DBPASS: e0Ycd8oldMKUlZy3 + NEUTRON_DBPASS: KSVmObwR2LV0yHZZ + NEUTRON_PASS: nUSx64eOlkgBko9v + NOVA_DBPASS: 2xzrfLAnwnkslKZt + NOVA_PASS: w6d2wiBOt69JfMsg + RABBIT_PASS: Bo81kwBqTVcpjDv5 + SWIFT_PASS: HhY0Zsts49gU6fCn + MARIADB_PASS: JONoHo8sYbhs diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 0287ed1..03601c8 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -26,3 +26,6 @@ owner: root group: root + #- name: Load secrets file + # include_vars: + # file: secrets/password_list.yml diff --git a/roles/keystone/files/keystone.conf b/roles/keystone/files/keystone.conf new file mode 100644 index 0000000..81e8149 --- /dev/null +++ b/roles/keystone/files/keystone.conf @@ -0,0 +1,8 @@ +[DEFAULT] + +[database] + +connection = mysql+pymysql://keystone:keystone@mariadb/keystone + +[token] +provider = fernet diff --git a/roles/rabbitmq/files/rabbitmq.service b/roles/rabbitmq/files/rabbitmq.service new file mode 100644 index 0000000..7732b68 --- /dev/null +++ b/roles/rabbitmq/files/rabbitmq.service @@ -0,0 +1,18 @@ +[Unit] +Description=rabbitmq Container +After=docker.service +Requires=docker.service + +[Service] +TimeoutStartSec=0 +Restart=always +ExecStartPre=-/usr/bin/docker stop %n +ExecStartPre=-/usr/bin/docker rm %n +ExecStartPre=/usr/bin/docker pull rabbitmq:latest +ExecStart=/usr/bin/docker run -d \ + -p 4369:4369 -p 25679:25679 -p 5671-5672:5671-5672 -p 8080:15672 \ + -e "RABBITMQ_DEFAULT_USER=user" -e "RABBITMQ_DEFAULT_PASS=password" \ + --hostname rabbitmq --name %n rabbitmq:3-management + +[Install] +WantedBy=multi-user.target diff --git a/roles/rabbitmq/tasks/main.yml b/roles/rabbitmq/tasks/main.yml new file mode 100644 index 0000000..c5d7dc6 --- /dev/null +++ b/roles/rabbitmq/tasks/main.yml @@ -0,0 +1,16 @@ +# Install a docker based rabbitMQ. +--- +- include: ../common/tasks/docker.yml +- name: install service file. + template: + src: files/rabbitmq.service + dest: /etc/systemd/system/rabbitmq.service + mode: 644 + owner: root + group: root +- name: install service file + command: systemctl daemon-reload +- name: make sure service is started + systemd: + name: rabbitmq.service + state: started