- dashboard
- heat
- aodh
+ - congress
- hosts: all
remote_user: root
-##############################################################################
+#############################################################################
# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
#
# All rights reserved. This program and the accompanying materials
login_unix_socket: /var/run/mysqld/mysqld.sock
name: "{{ item.db }}"
state: present
- with_items: "{{ credentials }}"
+ with_items: "{{ congress_database }}"
- name: create congress db user
mysql_user:
host: "{{ item[1] }}"
state: present
with_nested:
- - "{{ credentials }}"
+ - "{{ congress_database }}"
- ['%', 'localhost']
+
+- name: congress db sync
+ shell: |
+ "{{ congress_path }}"/congress-db-manage \
+ --config-file /etc/congress/congress.conf upgrade head
+ notify:
+ - restart congress services
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
-- include_vars: "{{ ansible_os_family }}.yml"
-
- name: install congress packages
pip: name={{ item }} state=present
- with_items: "{{ packages }}"
+ with_items: "{{ pip_packages | union(packages_noarch) }}"
- name: create congress etc directory
file: path=/etc/congress state=directory
- congress.conf
- api-paste.ini
- policy.json
+ notify:
+ - restart congress services
- name: create congress service
- copy: src=congress.service dest=/lib/systemd/system/
+ template: src=congress.service dest=/lib/systemd/system/
+ notify:
+ - restart congress services
- name: create congress service work dir
file: path=/var/lib/congress state=directory
--- /dev/null
+##############################################################################
+# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+---
+- name: add service
+ os_keystone_service:
+ cloud: opnfv
+ name: "{{ item.name }}"
+ description: "{{ item.description }}"
+ service_type: "{{ item.type }}"
+ with_items: "{{ congress_service }}"
+
+- name: add user
+ os_user:
+ cloud: opnfv
+ domain: default
+ name: "{{ item.user }}"
+ password: "{{ item.password }}"
+ default_project: "{{ item.tenant }}"
+ email: "{{ item.email }}"
+ with_items: "{{ congress_user }}"
+
+- name: grant roles
+ os_user_role:
+ cloud: opnfv
+ user: "{{ item.user }}"
+ role: "{{ item.role }}"
+ project: "{{ item.tenant }}"
+ with_items: "{{ congress_user }}"
+
+- name: create admin url for service's endpoint
+ keystone_endpoint:
+ cloud: opnfv
+ endpoint_type: admin
+ name: "{{ item.name }}"
+ service_type: "{{ item.type }}"
+ state: present
+ interface: admin
+ region: "{{ item.region}}"
+ url: "{{ item.adminurl }}"
+ with_items: "{{ congress_service }}"
+
+- name: create internal url for service's endpoint
+ keystone_endpoint:
+ cloud: opnfv
+ endpoint_type: admin
+ name: "{{ item.name }}"
+ service_type: "{{ item.type }}"
+ state: present
+ interface: internal
+ region: "{{ item.region}}"
+ url: "{{ item.internalurl }}"
+ with_items: "{{ congress_service }}"
+
+- name: create public url for service'e endpoint
+ keystone_endpoint:
+ cloud: opnfv
+ endpoint_type: admin
+ name: "{{ item.name }}"
+ service_type: "{{ item.type }}"
+ state: present
+ interface: public
+ region: "{{ item.region}}"
+ url: "{{ item.publicurl }}"
+ with_items: "{{ congress_service }}"
--- /dev/null
+##############################################################################
+## Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others.
+##
+## All rights reserved. This program and the accompanying materials
+## are made available under the terms of the Apache License, Version 2.0
+## which accompanies this distribution, and is available at
+## http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+---
+- name: start congress services
+ service: name={{ item }} state=started enabled=yes
+ with_items: "{{ services | union(services_noarch) }}"
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
+- include_vars: "{{ ansible_os_family }}.yml"
+ tags:
+ - install
+ - start
+
- include: congress_install.yml
+ tags:
+ - install
-- include: congress_db.yml
+- include: congress_keystone.yml
when:
- inventory_hostname == haproxy_hosts.keys()[0]
+ tags:
+ - keystone
+
+- include: congress_database.yml
+ when:
+ - inventory_hostname == haproxy_hosts.keys()[0]
+ tags:
+ - database
+
+- include: congress_start.yml
+ tags:
+ - start
-- include: congress_config.yml
+- meta: flush_handlers
+ tags:
+ - install
+ - keystone
+ - database
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/lock/congress /var/log/congress /var/lib/congress
ExecStartPre=/usr/bin/touch /var/log/congress/congress.log
-ExecStart=/usr/local/bin/congress-server --config-file /etc/congress/congress.conf
+ExecStart={{ congress_path }}/congress-server --config-file /etc/congress/congress.conf
Restart=on-failure
LimitNOFILE=65535
TimeoutStopSec=15
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
-packages:
+pip_packages:
- congress
- python-congressclient
- python-cloudfoundryclient
-service:
+services:
- congress
-credentials:
- - user: congress
- db: congress
- password: "{{ CONGRESS_DBPASS }}"
+congress_path: /usr/local/bin
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
---
-- name: congress db sync
- shell: |
- /usr/local/bin/congress-db-manage \
- --config-file /etc/congress/congress.conf upgrade head
- when: inventory_hostname == haproxy_hosts.keys()[0]
+pip_packages:
+ - congress
+ - python-congressclient
+ - python-cloudfoundryclient
-- name: start congress service
- shell: systemctl start congress.service
+services:
+ - congress
+
+congress_path: /usr/bin
packages_noarch: []
services_noarch: []
+
+congress_service:
+ - name: congress
+ type: policy
+ region: RegionOne
+ description: "OpenStack Policy Service"
+ publicurl: "http://{{ public_vip.ip }}:1789"
+ internalurl: "http://{{ internal_vip.ip }}:1789"
+ adminurl: "http://{{ internal_vip.ip }}:1789"
+
+congress_user:
+ - user: congress
+ password: "{{ CONGRESS_PASS }}"
+ email: congress@admin.com
+ role: admin
+ tenant: service
+ tenant_description: "Service Tenant"
+
+congress_database:
+ - user: congress
+ db: congress
+ password: "{{ CONGRESS_DBPASS }}"
"heat": {
"username": "heat",
"password": "heat"
+ },
+ "policy": {
+ "username": "congress",
+ "password": "congress"
}
}
}
#set ceilometer_pass = $console_credentials.metering.password
#set aodh_dbpass = $credentials.alarming.password
#set aodh_pass = $console_credentials.alarming.password
+#set congress_dbpass = $credentials.policy.password
+#set congress_pass = $console_credentials.policy.password
#set admin_pass = $console_credentials.admin.password
#set demo_pass = $console_credentials.demo.password
NEUTRON_PASS: $neutron_pass
HEAT_DBPASS: $heat_dbpass
HEAT_PASS: $heat_pass
+CONGRESS_DBPASS: $congress_dbpass
+CONGRESS_PASS: $congress_pass
DEMO_PASS: $demo_pass
ADMIN_PASS: $admin_pass