aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2015-11-26 19:39:56 +0800
committerchenshuai@huawei.com <chenshuai@huawei.com>2015-12-02 10:05:25 +0800
commitfd5db7e03c9595c14df71a49e778a3bdda89e344 (patch)
treeb4534b95f5739f49a7238703d4f82f497854af6a /deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
parent3c48d787b3caa3a12153257abf66e3211109b8f5 (diff)
OpenContrail intergration
JIRA: COMPASS-168 Change-Id: I0fe22568fb28019a0085e8bbf9b600acfa9e8f45 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml')
-rwxr-xr-xdeploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml280
1 files changed, 280 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
new file mode 100755
index 00000000..8aa8f43b
--- /dev/null
+++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml
@@ -0,0 +1,280 @@
+---
+#- hosts: config
+# sudo: yes
+# tasks:
+- name: "enable supervisor config"
+ file:
+ path: "/etc/init/supervisor-config.override"
+ state: "absent"
+
+- name: "enable neutron server"
+ file:
+ path: "/etc/init/neutron-server.override"
+ state: "absent"
+
+# Compass is using this
+#- name: "enable haproxy"
+# replace:
+# dest: "/etc/default/haproxy"
+# regexp: "^ENABLED\\s*=.*$"
+# replace: "ENABLED=1"
+
+# Compass is using this
+#- name: "modify haproxy global configuration"
+# lineinfile:
+# dest: "/etc/haproxy/haproxy.cfg"
+# regexp: "{{ item.regexp }}"
+# line: "{{ item.line }}"
+# insertafter: "^global"
+# with_items:
+# - { regexp: "^\\s*tune.bufsize", line: "\ttune.bufsize 16384" }
+# - { regexp: "^\\s*tune.maxrewrite", line: "\ttune.maxrewrite 1024" }
+
+- name: "delete haproxy configuration for contrail"
+ shell: "sed -i -e '/^#contrail-marker-start/,/^#contrail-marker-end/d' /etc/haproxy/haproxy.cfg"
+
+- name: "create haproxy configuration for contrail"
+ template:
+ src: "provision/haproxy-contrail-cfg.j2"
+ dest: "/tmp/haproxy-contrail.cfg"
+
+- name: "combination of the haproxy configuration"
+ shell: "cat /tmp/haproxy-contrail.cfg >> /etc/haproxy/haproxy.cfg"
+
+- name: "delete temporary configuration file"
+ file:
+ dest: "/tmp/haproxy-contrail.cfg"
+ state: "absent"
+
+- name: "restart haproxy"
+ service:
+ name: "haproxy"
+ state: "restarted"
+
+# Compass is using this
+#- name: "create keepalived configuration"
+# template:
+# src: "provision/keepalived-conf.j2"
+# dest: "/etc/keepalived/keepalived.conf"
+# with_indexed_items: groups['opencontrail_config']
+# when: contrail_keepalived and item.1 == inventory_hostname
+
+#- name: "restart keepalived"
+# service:
+# name: "keepalived"
+# state: "restarted"
+# when: contrail_keepalived
+
+- name: "node-common"
+ include: -node-common.yml
+
+- name: "fix up contrail keystone auth config"
+ template:
+ src: "provision/contrail-keystone-auth-conf.j2"
+ dest: "/etc/contrail/contrail-keystone-auth.conf"
+
+- name: "fix up ifmap server log4j properties"
+ template:
+ src: "provision/ifmap-log4j-properties.j2"
+ dest: "/etc/ifmap-server/log4j.properties"
+
+- name: "fix up ifmap server authorization properties"
+ template:
+ src: "provision/ifmap-authorization-properties.j2"
+ dest: "/etc/ifmap-server/authorization.properties"
+
+- name: "fix up ifmap server basicauthusers properties"
+ template:
+ src: "provision/ifmap-basicauthusers-properties.j2"
+ dest: "/etc/ifmap-server/basicauthusers.properties"
+
+- name: "fix up ifmap server publisher properties"
+ template:
+ src: "provision/ifmap-publisher-properties.j2"
+ dest: "/etc/ifmap-server/publisher.properties"
+
+- name: "fix up contrail api config"
+ template:
+ src: "provision/contrail-api-conf.j2"
+ dest: "/etc/contrail/contrail-api.conf"
+
+- name: "fix up contrail api supervisord config"
+ template:
+ src: "provision/contrail-api-supervisord-conf.j2"
+ dest: "/etc/contrail/supervisord_config_files/contrail-api.ini"
+
+- name: "modify contrail api init script"
+ lineinfile:
+ dest: "/etc/init.d/contrail-api"
+ regexp: "supervisorctl -s unix:///tmp/supervisord_config.sock"
+ line: "supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}:0`"
+
+- name: "fix up contrail schema config"
+ template:
+ src: "provision/contrail-schema-conf.j2"
+ dest: "/etc/contrail/contrail-schema.conf"
+
+- name: "fix up contrail device manager config"
+ template:
+ src: "provision/contrail-device-manager-conf.j2"
+ dest: "/etc/contrail/contrail-device-manager.conf"
+
+- name: "fix up contrail svc monitor config"
+ template:
+ src: "provision/contrail-svc-monitor-conf.j2"
+ dest: "/etc/contrail/contrail-svc-monitor.conf"
+
+- name: "fix up contrail discovery supervisord config"
+ template:
+ src: "provision/contrail-discovery-supervisord-conf.j2"
+ dest: "/etc/contrail/supervisord_config_files/contrail-discovery.ini"
+
+- name: "fix up contrail discovery config"
+ template:
+ src: "provision/contrail-discovery-conf.j2"
+ dest: "/etc/contrail/contrail-discovery.conf"
+
+- name: "modify contrail discovery init script"
+ lineinfile:
+ dest: "/etc/init.d/contrail-discovery"
+ regexp: "supervisorctl -s unix:///tmp/supervisord_config.sock"
+ line: "supervisorctl -s unix:///tmp/supervisord_config.sock ${1} `basename ${0}:0`"
+
+- name: "fix up contrail vnc api library config"
+ template:
+ src: "provision/contrail-vnc-api-lib-ini.j2"
+ dest: "/etc/contrail/vnc_api_lib.ini"
+
+- name: "fix up contrail config nodemgr config"
+ ini_file:
+ dest: "/etc/contrail/contrail-config-nodemgr.conf"
+ section: "DISCOVERY"
+ option: "server"
+ value: "{{ contrail_haproxy_address }}"
+
+- name: "fix up contrail sudoers"
+ template:
+ src: "provision/contrail-sudoers.j2"
+ dest: "/etc/sudoers.d/contrail_sudoers"
+ mode: 0440
+
+- name: "create directory for neutron plugins"
+ file:
+ dest: "/etc/neutron/plugins/opencontrail"
+ state: "directory"
+
+- name: "fix up contrail plugin for nuetron"
+ template:
+ src: "provision/neutron-contrail-plugin-ini.j2"
+ dest: "/etc/neutron/plugins/opencontrail/ContrailPlugin.ini"
+
+- name: "modify neutron server configuration"
+ lineinfile:
+ dest: "/etc/default/neutron-server"
+ regexp: "NEUTRON_PLUGIN_CONFIG="
+ line: "NEUTRON_PLUGIN_CONFIG=\"/etc/neutron/plugins/opencontrail/ContrailPlugin.ini\""
+
+#- name: "change owner neutron log directory"
+# file:
+# dest: "/var/log/neutron"
+# state: "directory"
+# owner: "neutron"
+# group: "neutron"
+# recurse: yes
+
+#- name: "set values to neutron config"
+# ini_file:
+# dest: "/etc/neutron/neutron.conf"
+# section: "{{ item.section }}"
+# option: "{{ item.option }}"
+# value: "{{ item.value }}"
+# with_items:
+# - { section: "DEFAULT", option: "bind_port", value: "9697" }
+# - { section: "DEFAULT", option: "auth_strategy", value: "keystone" }
+# - { section: "DEFAULT", option: "allow_overlapping_ips", value: "True" }
+# - { section: "DEFAULT", option: "core_plugin", value: "neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2" }
+# - { section: "DEFAULT", option: "api_extensions_path", value: "extensions:/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/extensions" }
+# - { section: "DEFAULT", option: "rabbit_host", value: "{{ contrail_haproxy_address }}" }
+# - { section: "DEFAULT", option: "rabbit_port", value: "5673" }
+# - { section: "DEFAULT", option: "service_plugins", value: "neutron_plugin_contrail.plugins.opencontrail.loadbalancer.plugin.LoadBalancerPlugin" }
+# - { section: "service_providers", option: "service_provider", value: "LOADBALANCER:Opencontrail:neutron_plugin_contrail.plugins.opencontrail.loadbalancer.driver.OpencontrailLoadbalancerDriver:default" }
+# - { section: "quotas", option: "quota_driver", value: "neutron_plugin_contrail.plugins.opencontrail.quota.driver.QuotaDriver" }
+# - { section: "quotas", option: "quota_network", value: "-1" }
+# - { section: "quotas", option: "quota_subnet", value: "-1" }
+# - { section: "quotas", option: "quota_port", value: "-1" }
+# - { section: "keystone_authtoken", option: "admin_tenant_name", value: "admin" }
+# - { section: "keystone_authtoken", option: "admin_user", value: "{{ contrail_admin_user }}" }
+# - { section: "keystone_authtoken", option: "admin_password", value: "{{ contrail_admin_password }}" }
+# - { section: "keystone_authtoken", option: "auth_host", value: "{{ contrail_keystone_address }}" }
+# - { section: "keystone_authtoken", option: "auth_protocol", value: "http" }
+
+#- name: "add respawn to neutron server config"
+# lineinfile:
+# dest: "/etc/init/neutron-server.conf"
+# line: "respawn"
+# insertbefore: "pre-start script"
+
+#- name: "add respawn limit to neutron server config"
+# lineinfile:
+# dest: "/etc/init/neutron-server.conf"
+# line: "respawn limit 10 90"
+# insertafter: "respawn"
+
+- name: "restart supervisor config"
+ service:
+ name: "supervisor-config"
+ state: "restarted"
+
+
+#- name: "restart neutron-server"
+# service:
+# name: "neutron-server"
+# state: "restarted"
+
+# Compass configured
+#- name: "add neutron service"
+# shell: "keystone service-get 'neutron' || keystone service-create --name 'neutron' --type 'network' --description 'Neutron Network Service'"
+# environment:
+# OS_AUTH_URL: "http://{{ contrail_keystone_address }}:35357/v2.0"
+# OS_USERNAME: "{{ contrail_admin_user }}"
+# OS_PASSWORD: "{{ contrail_admin_password }}"
+# OS_TENANT_NAME: "admin"
+# run_once: yes
+# when: keystone_provision
+#
+#
+# Compass configured
+#- name: "add neutron endpoint"
+# shell: "keystone endpoint-list | grep -q $(keystone service-get 'neutron' | grep '| *id *|' | awk '{print $4}') || keystone endpoint-create --region 'RegionOne' --service 'neutron' --publicurl 'http://{{ contrail_haproxy_address }}:9696' --internal 'http://{{ contrail_haproxy_address }}:9696' --adminurl 'http://{{ contrail_haproxy_address }}:9696'"
+# environment:
+# OS_AUTH_URL: "http://{{ contrail_keystone_address }}:35357/v2.0"
+# OS_USERNAME: "{{ contrail_admin_user }}"
+# OS_PASSWORD: "{{ contrail_admin_password }}"
+# OS_TENANT_NAME: "admin"
+# run_once: yes
+# when: keystone_provision
+#
+#- name: "add neutron user"
+# keystone_user:
+# user: "neutron"
+# password: "{{ contrail_admin_password }}"
+# email: "neutron@example.com"
+# tenant: "service"
+# endpoint: "http://{{ contrail_keystone_address }}:35357/v2.0"
+# login_user: "{{ contrail_admin_user }}"
+# login_password: "{{ contrail_admin_password }}"
+# login_tenant_name: "admin"
+# run_once: yes
+# when: keystone_provision
+#
+#- name: "apply role to user"
+# keystone_user:
+# tenant: "service"
+# user: "neutron"
+# role: "admin"
+# endpoint: "http://{{ contrail_keystone_address }}:35357/v2.0"
+# login_user: "{{ contrail_admin_user }}"
+# login_password: "{{ contrail_admin_password }}"
+# login_tenant_name: "admin"
+# run_once: yes
+# when: keystone_provision