diff options
Diffstat (limited to 'deploy')
28 files changed, 279 insertions, 243 deletions
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 66e568ac..787cf97c 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -215,6 +215,12 @@ serial: 1 max_fail_percentage: 0 roles: + - odl_cluster_neutron + +- hosts: all + remote_user: root + max_fail_percentage: 0 + roles: - odl_cluster_post - hosts: controller diff --git a/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml b/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml index c6a9fb9c..864ea97a 100644 --- a/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml +++ b/deploy/adapters/ansible/roles/ceilometer_compute/tasks/main.yml @@ -9,10 +9,23 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install ceilometer packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: ceilometer_packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: copy ceilometer configs template: src={{ item.src}} dest=/opt/os_templates with_items: "{{ ceilometer_configs_templates }}" diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml index 261e1ec4..6b1882cc 100644 --- a/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml +++ b/deploy/adapters/ansible/roles/ceilometer_controller/tasks/main.yml @@ -9,15 +9,27 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install ceilometer packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: ceilometer_packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: copy ceilometer configs template: src={{ item.src}} dest=/opt/os_templates with_items: "{{ ceilometer_configs_templates }}" - - name: update ceilometer configs shell: crudini --merge {{ item.1 }} < /opt/os_templates/{{ item.0.src }} with_subelements: diff --git a/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml b/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml index f4d4e055..d41094da 100644 --- a/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml +++ b/deploy/adapters/ansible/roles/cinder-controller/tasks/cinder_install.yml @@ -7,10 +7,23 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install cinder packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: generate common cinder service list lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: services | union(services_noarch) diff --git a/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml b/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml index 47336c76..f3f40c12 100644 --- a/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml +++ b/deploy/adapters/ansible/roles/cinder-volume/tasks/main.yml @@ -9,10 +9,23 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install cinder-volume and lvm2 packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: generate cinder volume service list lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: services | union(services_noarch) diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster.yml index 84704fa4..8fdb1437 100644 --- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster.yml +++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster.yml @@ -7,8 +7,52 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- include: mariadb_cluster_debian.yml - when: ansible_os_family == "Debian" +- name: get cluster status + shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"'|awk '{print $2}' + register: cluster_status + when: + - inventory_hostname == haproxy_hosts.keys()[0] -- include: mariadb_cluster_redhat.yml - when: ansible_os_family == "RedHat" +- name: start first node to create new cluster + service: + name: mysql + state: restarted + enabled: yes + args: "--wsrep-new-cluster" + when: | + inventory_hostname == haproxy_hosts.keys()[0] + and not cluster_status.stdout | search("OPERATIONAL") + +- name: wait for cluster ready + shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"'|awk '{print $2}' + register: cluster_status + until: cluster_status|success + failed_when: not cluster_status.stdout | search("OPERATIONAL") + retries: 10 + delay: 3 + when: | + inventory_hostname == haproxy_hosts.keys()[0] + and not cluster_status.stdout | search("OPERATIONAL") + +- name: if I in the cluster nodes + shell: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_incoming_addresses"'|awk '{print $2}' + register: cluster_nodes + changed_when: false + +- name: restart other nodes and join cluster + service: + name: mysql + state: restarted + enabled: yes + when: | + inventory_hostname != haproxy_hosts.keys()[0] + and not cluster_nodes.stdout | search("{{ internal_ip }}") + +- name: restart first nodes + service: + name: mysql + state: restarted + when: | + (inventory_hostname == haproxy_hosts.keys()[0] + and haproxy_hosts|length > 1 + and not cluster_nodes.stdout | search('{{ internal_ip }}')) diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml deleted file mode 100644 index 2ae9a2b0..00000000 --- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_debian.yml +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################## -# 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 first node to create new cluster - service: - name: mysql - state: restarted - enabled: yes - args: "--wsrep-new-cluster" - when: - - inventory_hostname == haproxy_hosts.keys()[0] - -- name: wait for cluster ready - command: mysql --silent --skip-column-names -e 'SHOW STATUS LIKE "wsrep_evs_state"' - register: cluster_status - until: cluster_status|success - failed_when: not cluster_status.stdout | search("OPERATIONAL") - retries: 10 - delay: 3 - when: - - inventory_hostname == haproxy_hosts.keys()[0] - -- name: restart other nodes and join cluster - service: - name: mysql - state: restarted - enabled: yes - when: - - inventory_hostname != haproxy_hosts.keys()[0] - -- name: restart first nodes - service: - name: mysql - state: restarted - when: inventory_hostname == haproxy_hosts.keys()[0] and haproxy_hosts|length > 1 diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml deleted file mode 100755 index 2fbde33b..00000000 --- a/deploy/adapters/ansible/roles/database/tasks/mariadb_cluster_redhat.yml +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################## -# 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 first node to create new cluster - shell: service mysql start --wsrep-new-cluster - when: - - inventory_hostname == haproxy_hosts.keys()[0] - -- name: wait for cluster ready - command: mysql -e"show status like 'wsrep%'" - register: cluster_status - until: cluster_status|success - failed_when: not cluster_status.stdout | search("ON") - retries: 10 - delay: 3 - when: - - inventory_hostname == haproxy_hosts.keys()[0] - -- name: restart other nodes and join cluster - service: - name: mysql - state: restarted - enabled: yes - when: - - inventory_hostname != haproxy_hosts.keys()[0] - -- name: restart first nodes - service: - name: mysql - state: restarted - when: inventory_hostname == haproxy_hosts.keys()[0] and haproxy_hosts|length > 1 diff --git a/deploy/adapters/ansible/roles/database/tasks/mariadb_install.yml b/deploy/adapters/ansible/roles/database/tasks/mariadb_install.yml index 14fe1634..bf9f3464 100644 --- a/deploy/adapters/ansible/roles/database/tasks/mariadb_install.yml +++ b/deploy/adapters/ansible/roles/database/tasks/mariadb_install.yml @@ -45,17 +45,25 @@ - "\\s*uid = \\$MYUID$" - "\\s*gid = \\$MYGID$" -- stat: path=/opt/mysql_init_complete - register: mysql_init_complete - - name: enable auto start file: path=/usr/sbin/policy-rc.d state=absent when: ansible_os_family == "Debian" -- name: rm old datafiles - shell: rm -rf /var/lib/mysql/ib_logfile* - - name: set owner file: path=/var/lib/mysql owner=mysql group=mysql recurse=yes state=directory + +- name: get logfile stat + stat: path='{{ mysql_data_dir }}/ib_logfile0' + register: logfile_stat + +- debug: msg='{{ logfile_stat.stat.exists}}' +- debug: msg='{{ logfile_stat.stat.size }}' + when: logfile_stat.stat.exists + +- name: rm logfile if exist and size mismatch + shell: 'rm -rf {{ mysql_data_dir }}/ib_logfile*' + when: | + logfile_stat.stat.exists + and logfile_stat.stat.size != 1073741824 diff --git a/deploy/adapters/ansible/roles/database/templates/my.cnf b/deploy/adapters/ansible/roles/database/templates/my.cnf index 68e0fca2..f1170ece 100644 --- a/deploy/adapters/ansible/roles/database/templates/my.cnf +++ b/deploy/adapters/ansible/roles/database/templates/my.cnf @@ -56,4 +56,4 @@ quote-names max_allowed_packet = 16M -!includedir /etc/my.cnf.d/ +!includedir {{ mysql_config_dir }} diff --git a/deploy/adapters/ansible/roles/database/templates/my_debian.cnf b/deploy/adapters/ansible/roles/database/templates/my_debian.cnf deleted file mode 100644 index b8016849..00000000 --- a/deploy/adapters/ansible/roles/database/templates/my_debian.cnf +++ /dev/null @@ -1,59 +0,0 @@ -[client] -port = 3306 -socket = /var/run/mysqld/mysqld.sock - - -[mysqld_safe] -socket = /var/run/mysqld/mysqld.sock -nice = 0 - - -[mysql] -default-character-set = utf8 - -[mysqld] -user = mysql -collation-server = utf8_unicode_ci -init-connect = 'SET NAMES utf8' -character-set-server = utf8 -datadir = /var/lib/mysql -bind-address = {{ internal_ip }} - -max-allowed-packet = 16M -max-connect-errors = 1000000 - -max_connections = {{ ansible_processor_vcpus * 100 }} - -wait_timeout = 28800 -tmp-table-size = 32M -max-heap-table-size = 32M -query-cache-type = 0 -query-cache-size = 0M -thread-cache-size = 50 -open-files-limit = 65535 -table-definition-cache = 4096 -table-open-cache = 10240 - -innodb-flush-method = O_DIRECT -innodb-additional-mem-pool-size = 24M -innodb-log-file-size = 1024M -innodb-file-per-table = 1 -innodb-buffer-pool-size = 4096M - -innodb-read-io-threads = 4 -innodb-write-io-threads = 4 -innodb-doublewrite = 1 -innodb-log-buffer-size = 1024M -innodb-buffer-pool-instances = 8 -innodb-log-files-in-group = 2 -innodb-thread-concurrency = {{ ansible_processor_vcpus * 2 }} - -innodb_stats_on_metadata = 0 - -[mysqldump] -quick -quote-names -max_allowed_packet = 16M - - -!includedir /etc/mysql/conf.d/ diff --git a/deploy/adapters/ansible/roles/database/templates/my_redhat.cnf b/deploy/adapters/ansible/roles/database/templates/my_redhat.cnf deleted file mode 100644 index 68e0fca2..00000000 --- a/deploy/adapters/ansible/roles/database/templates/my_redhat.cnf +++ /dev/null @@ -1,59 +0,0 @@ -[client] -port = 3306 -socket = /var/run/mysqld/mysqld.sock - - -[mysqld_safe] -socket = /var/run/mysqld/mysqld.sock -nice = 0 - - -[mysql] -default-character-set = utf8 - -[mysqld] -user = mysql -collation-server = utf8_unicode_ci -init-connect = 'SET NAMES utf8' -character-set-server = utf8 -datadir = /var/lib/mysql -bind-address = {{ internal_ip }} - -max-allowed-packet = 16M -max-connect-errors = 1000000 - -max_connections = {{ ansible_processor_vcpus * 100 }} - -wait_timeout = 28800 -tmp-table-size = 32M -max-heap-table-size = 32M -query-cache-type = 0 -query-cache-size = 0M -thread-cache-size = 50 -open-files-limit = 65535 -table-definition-cache = 4096 -table-open-cache = 10240 - -innodb-flush-method = O_DIRECT -innodb-additional-mem-pool-size = 24M -innodb-log-file-size = 1024M -innodb-file-per-table = 1 -innodb-buffer-pool-size = 4096M - -innodb-read-io-threads = 4 -innodb-write-io-threads = 4 -innodb-doublewrite = 1 -innodb-log-buffer-size = 1024M -innodb-buffer-pool-instances = 8 -innodb-log-files-in-group = 2 -innodb-thread-concurrency = {{ ansible_processor_vcpus * 2 }} - -innodb_stats_on_metadata = 0 - -[mysqldump] -quick -quote-names -max_allowed_packet = 16M - - -!includedir /etc/my.cnf.d/ diff --git a/deploy/adapters/ansible/roles/database/vars/Debian.yml b/deploy/adapters/ansible/roles/database/vars/Debian.yml index 2eefc703..621dc492 100644 --- a/deploy/adapters/ansible/roles/database/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/database/vars/Debian.yml @@ -30,10 +30,13 @@ services: [] mongodb_service: mongodb mysql_config: - dest: /etc/mysql/my.cnf - src: my_debian.cnf + src: my.cnf - dest: /etc/mysql/conf.d/wsrep.cnf src: wsrep.cnf +mysql_config_dir: /etc/mysql/conf.d +mysql_data_dir: /var/lib/mysql + mongodb_config: dest: /etc/mongodb.conf src: mongodb.conf diff --git a/deploy/adapters/ansible/roles/database/vars/RedHat.yml b/deploy/adapters/ansible/roles/database/vars/RedHat.yml index fe2d3f0a..aed1ac98 100644 --- a/deploy/adapters/ansible/roles/database/vars/RedHat.yml +++ b/deploy/adapters/ansible/roles/database/vars/RedHat.yml @@ -31,10 +31,13 @@ mongodb_service: mongod mysql_config: - dest: /etc/my.cnf - src: my_redhat.cnf + src: my.cnf - dest: /etc/my.cnf.d/wsrep.cnf src: wsrep.cnf +mysql_config_dir: /etc/my.cnf.d +mysql_data_dir: /var/lib/mysql + mongodb_config: dest: /etc/mongod.conf src: mongodb.conf diff --git a/deploy/adapters/ansible/roles/memcached/handlers/main.yml b/deploy/adapters/ansible/roles/memcached/handlers/main.yml new file mode 100644 index 00000000..4c3230c1 --- /dev/null +++ b/deploy/adapters/ansible/roles/memcached/handlers/main.yml @@ -0,0 +1,12 @@ +############################################################################## +# 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: restart memcahed services + service: name={{ item }} state=restarted enabled=yes + with_items: services| union(services_noarch) diff --git a/deploy/adapters/ansible/roles/memcached/tasks/main.yml b/deploy/adapters/ansible/roles/memcached/tasks/main.yml index 732076ae..99ee6e87 100644 --- a/deploy/adapters/ansible/roles/memcached/tasks/main.yml +++ b/deploy/adapters/ansible/roles/memcached/tasks/main.yml @@ -9,16 +9,27 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest update_cache=yes" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: change memcache listen ip lineinfile: dest=/etc/memcached.conf regexp="^-l " line="-l 0.0.0.0" when: ansible_os_family == "Debian" - -- name: restart services - service: name={{ item }} state=restarted enabled=yes - with_items: services| union(services_noarch) + notify: + - restart memcahed services - meta: flush_handlers diff --git a/deploy/adapters/ansible/roles/neutron-compute/tasks/main.yml b/deploy/adapters/ansible/roles/neutron-compute/tasks/main.yml index 9020ccae..3e4b24bc 100644 --- a/deploy/adapters/ansible/roles/neutron-compute/tasks/main.yml +++ b/deploy/adapters/ansible/roles/neutron-compute/tasks/main.yml @@ -21,10 +21,23 @@ sysctl: name=net.ipv4.conf.default.rp_filter value=0 state=present reload=yes +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install compute-related neutron packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: fix openstack neutron plugin config file shell: | sed -i 's,plugins/ml2/openvswitch_agent.ini,plugin.ini,g' /usr/lib/systemd/system/neutron-openvswitch-agent.service diff --git a/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_install.yml b/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_install.yml index 600fe157..be64c41c 100644 --- a/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_install.yml +++ b/deploy/adapters/ansible/roles/neutron-controller/tasks/neutron_install.yml @@ -9,10 +9,23 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install controller-related neutron packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: generate neutron control service list lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: services | union(services_noarch) diff --git a/deploy/adapters/ansible/roles/neutron-network/tasks/firewall.yml b/deploy/adapters/ansible/roles/neutron-network/tasks/firewall.yml index c0246663..aec714f3 100755 --- a/deploy/adapters/ansible/roles/neutron-network/tasks/firewall.yml +++ b/deploy/adapters/ansible/roles/neutron-network/tasks/firewall.yml @@ -9,9 +9,22 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install firewall packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: firewall_packages +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: update firewall related conf shell: crudini --set --list /etc/neutron/neutron.conf DEFAULT service_plugins firewall diff --git a/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml b/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml index 924a02e5..9b41ac18 100644 --- a/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml +++ b/deploy/adapters/ansible/roles/neutron-network/tasks/main.yml @@ -31,10 +31,23 @@ failed_when: iproute_out.rc == 255 when: "'vxlan' in {{ NEUTRON_TUNNEL_TYPES }}" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install neutron network related packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: generate neutron network service list lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: services | union(services_noarch) diff --git a/deploy/adapters/ansible/roles/neutron-network/tasks/vpn.yml b/deploy/adapters/ansible/roles/neutron-network/tasks/vpn.yml index 896b4358..9722ab7c 100755 --- a/deploy/adapters/ansible/roles/neutron-network/tasks/vpn.yml +++ b/deploy/adapters/ansible/roles/neutron-network/tasks/vpn.yml @@ -9,10 +9,23 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install vpn packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: vpn_packages +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: update vpn related conf shell: crudini --set /etc/neutron/l3_agent.ini vpnagent vpn_device_driver neutron_vpnaas.services.vpn.device_drivers.strongswan_ipsec.StrongSwanDriver; crudini --set --list /etc/neutron/neutron.conf DEFAULT service_plugins vpnaas diff --git a/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml b/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml index b29d828d..7ee60baa 100644 --- a/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml +++ b/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml @@ -9,10 +9,23 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install nova-compute related packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: update nova-compute conf template: src=templates/{{ item }} dest=/etc/nova/{{ item }} with_items: diff --git a/deploy/adapters/ansible/roles/nova-controller/tasks/nova_install.yml b/deploy/adapters/ansible/roles/nova-controller/tasks/nova_install.yml index 5160c5e1..865ad2e5 100644 --- a/deploy/adapters/ansible/roles/nova-controller/tasks/nova_install.yml +++ b/deploy/adapters/ansible/roles/nova-controller/tasks/nova_install.yml @@ -9,10 +9,23 @@ --- - include_vars: "{{ ansible_os_family }}.yml" +- name: disable auto start + copy: + content: "#!/bin/sh\nexit 101" + dest: "/usr/sbin/policy-rc.d" + mode: 0755 + when: ansible_os_family == "Debian" + - name: install nova related packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" with_items: packages | union(packages_noarch) +- name: enable auto start + file: + path=/usr/sbin/policy-rc.d + state=absent + when: ansible_os_family == "Debian" + - name: generate nova control service list lineinfile: dest=/opt/service create=yes line='{{ item }}' with_items: services | union(services_noarch) diff --git a/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml new file mode 100755 index 00000000..751a02d7 --- /dev/null +++ b/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml @@ -0,0 +1,22 @@ +--- +- name: restart neutron-server + service: name=neutron-server state=restarted enabled=yes + when: inventory_hostname in groups['odl'] + +- name: add service daemon + shell: > + echo keepalived >> /opt/service ; + echo neutron-server >> /opt/service ; + when: inventory_hostname in groups['odl'] + +- name: restart neutron-l3-agent server + service: name=neutron-l3-agent state=restarted + when: inventory_hostname in groups['odl'] + +- name: restart neutron-dhcp-agent server + service: name=neutron-dhcp-agent state=restarted + when: inventory_hostname in groups['odl'] + +- name: restart neutron-metadata-agent server + service: name=neutron-metadata-agent state=restarted + when: inventory_hostname in groups['odl'] diff --git a/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml index 19e99e82..8432186c 100755..100644 --- a/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml @@ -1,26 +1,4 @@ --- -- name: restart neutron-server - service: name=neutron-server state=restarted enabled=yes - when: inventory_hostname in groups['odl'] - -- name: add service daemon - shell: > - echo keepalived >> /opt/service ; - echo neutron-server >> /opt/service ; - when: inventory_hostname in groups['odl'] - -- name: restart neutron-l3-agent server - service: name=neutron-l3-agent state=restarted - when: inventory_hostname in groups['odl'] - -- name: restart neutron-dhcp-agent server - service: name=neutron-dhcp-agent state=restarted - when: inventory_hostname in groups['odl'] - -- name: restart neutron-metadata-agent server - service: name=neutron-metadata-agent state=restarted - when: inventory_hostname in groups['odl'] - - name: restart opendaylight shell: sleep 60; service opendaylight restart; sleep 300; when: inventory_hostname in groups['odl'] diff --git a/deploy/conf/base.conf b/deploy/conf/base.conf index 540efec7..f009a4ac 100644 --- a/deploy/conf/base.conf +++ b/deploy/conf/base.conf @@ -1,3 +1,6 @@ +export DHA=${DHA:-$COMPASS_DIR/deploy/conf/vm_environment/os-nosdn-nofeature-ha.yml} +export NEUTRON=${NEUTRON:-$COMPASS_DIR/deploy/conf/neutron_cfg.yaml} +export NETWORK=${NETWORK:-$COMPASS_DIR/deploy/conf/network_cfg.yaml} export ISO_URL=${ISO_URL:-file://`pwd`/work/building/compass.iso} export INSTALL_IP=${INSTALL_IP:-10.1.0.12} export INSTALL_MASK=${INSTALL_MASK:-255.255.255.0} diff --git a/deploy/conf/cluster.conf b/deploy/conf/cluster.conf index f741895b..cae78be3 100644 --- a/deploy/conf/cluster.conf +++ b/deploy/conf/cluster.conf @@ -1,10 +1,13 @@ -# for Operating System -export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)ubuntu-14\.04\.3.*'} -#export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*15.*'} - # trustry/centos7 export OS_VERSION=${OS_VERSION:-"trusty"} +# for Operating System +if [ $OS_VERSION = 'trusty' ];then + export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)ubuntu-14\.04\.3.*'} +else + export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*15.*'} +fi + # liberty/kilo/juno export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"liberty"} diff --git a/deploy/config_parse.py b/deploy/config_parse.py index 63269f3b..21fe76d3 100644 --- a/deploy/config_parse.py +++ b/deploy/config_parse.py @@ -40,9 +40,6 @@ def export_config_file(s, config_file, conf_dir, ofile): if env.get('hosts', []): env.pop('hosts') - env.update({'NEUTRON': os.path.join(conf_dir, "neutron_cfg.yaml")}) - env.update({'NETWORK': os.path.join(conf_dir, "network_cfg.yaml")}) - env.update({'TYPE': s.get('TYPE', "virtual")}) env.update({'FLAVOR': s.get('FLAVOR', "cluster")}) env.update({'HOSTNAMES': hostnames(s, ',')}) |