diff options
author | liyuenan <liyuenan@huawei.com> | 2016-12-27 17:44:34 +0800 |
---|---|---|
committer | liyuenan <liyuenan@huawei.com> | 2017-01-05 09:42:35 +0800 |
commit | 92f6ca7bb6d7b2f295406aab34094b1dba76ff94 (patch) | |
tree | c4e62927a3bf9862f7ba9ce286cbece2c4335ef4 /deploy/adapters/ansible/roles/tacker | |
parent | 6072a49adb33f2bce3f48b9c7b8be7d96cf8501c (diff) |
Yamllint test
JIRA: COMPASS-516
Change-Id: I482ce9bc86f4f963258c5b8823e0b00e83556eef
Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/tacker')
3 files changed, 82 insertions, 42 deletions
diff --git a/deploy/adapters/ansible/roles/tacker/tasks/main.yml b/deploy/adapters/ansible/roles/tacker/tasks/main.yml index 2759e968..5df2253b 100755 --- a/deploy/adapters/ansible/roles/tacker/tasks/main.yml +++ b/deploy/adapters/ansible/roles/tacker/tasks/main.yml @@ -11,4 +11,5 @@ - name: Install Tacker on Controller include: tacker_controller.yml - when: inventory_hostname in groups['controller'] and ansible_os_family == "Debian" + when: inventory_hostname in groups['controller'] + and ansible_os_family == "Debian" diff --git a/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml b/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml index 4e92557d..2d37ff13 100755 --- a/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml +++ b/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml @@ -12,31 +12,44 @@ register: http_server - name: creat tacker_home, tacker_client_home, tacker_horizon_home - shell: > - mkdir -p /opt/tacker - mkdir -p /opt/tacker_client - mkdir -p /opt/tacker_horizon + shell: | + mkdir -p /opt/tacker; + mkdir -p /opt/tacker_client; + mkdir -p /opt/tacker_horizon; - name: download tacker package - get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_pkg_name }}" dest=/opt/{{ tacker_pkg_name }} + get_url: + url: "http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_pkg_name }}" + dest: /opt/{{ tacker_pkg_name }} - name: download tacker_client package - get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_client_pkg_name }}" dest=/opt/{{ tacker_client_pkg_name }} + get_url: + url: "http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_client_pkg_name }}" + dest: /opt/{{ tacker_client_pkg_name }} - name: download tacker_horizon package - get_url: url="http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_horizon_pkg_name }}" dest=/opt/{{ tacker_horizon_pkg_name }} + get_url: + url: "http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_horizon_pkg_name }}" + dest: /opt/{{ tacker_horizon_pkg_name }} - name: extract tacker package - command: su -s /bin/sh -c "tar xzf /opt/{{ tacker_pkg_name }} -C {{ tacker_home }} --strip-components 1 --no-overwrite-dir -k --skip-old-files" + command: | + su -s /bin/sh -c "tar xzf /opt/{{ tacker_pkg_name }} -C {{ tacker_home }} \ + --strip-components 1 --no-overwrite-dir -k --skip-old-files" - name: extract tacker_client package - command: su -s /bin/sh -c "tar xzf /opt/{{ tacker_client_pkg_name }} -C {{ tacker_client_home }} --strip-components 1 --no-overwrite-dir -k --skip-old-files" + command: | + su -s /bin/sh -c "tar xzf /opt/{{ tacker_client_pkg_name }} -C {{ tacker_client_home }} \ + --strip-components 1 --no-overwrite-dir -k --skip-old-files" - name: extract tacker_horizon package - command: su -s /bin/sh -c "tar xzf /opt/{{ tacker_horizon_pkg_name }} -C {{ tacker_horizon_home }} --strip-components 1 --no-overwrite-dir -k --skip-old-files" + command: | + su -s /bin/sh -c "tar xzf /opt/{{ tacker_horizon_pkg_name }} -C {{ tacker_horizon_home }} \ + --strip-components 1 --no-overwrite-dir -k --skip-old-files" - name: edit ml2_conf.ini - shell: crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security; + shell: | + crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security; - name: Restart neutron-server service: name=neutron-server state=restarted @@ -65,9 +78,10 @@ state: "restarted" - name: drop and recreate tacker database - shell: mysql -e "drop database if exists tacker;"; - mysql -e "create database tacker character set utf8;"; - mysql -e "grant all on tacker.* to 'tacker'@'%' identified by 'TACKER_DBPASS';"; + shell: | + mysql -e "drop database if exists tacker;"; + mysql -e "create database tacker character set utf8;"; + mysql -e "grant all on tacker.* to 'tacker'@'%' identified by 'TACKER_DBPASS';"; when: inventory_hostname == haproxy_hosts.keys()[0] - name: get the openstack user info @@ -83,29 +97,45 @@ register: endpoint_info - name: delete the existed tacker endpoint - shell: . /opt/admin-openrc.sh; openstack endpoint delete $(openstack endpoint list | grep tacker | awk '{print $2}') - when: endpoint_info.stdout.find('tacker') != -1 and inventory_hostname == haproxy_hosts.keys()[0] + shell: | + . /opt/admin-openrc.sh; + openstack endpoint delete \ + $(openstack endpoint list | grep tacker | awk '{print $2}') + when: endpoint_info.stdout.find('tacker') != -1 + and inventory_hostname == haproxy_hosts.keys()[0] - name: delete the existed tacker service - shell: . /opt/admin-openrc.sh; openstack service delete tacker - when: service_info.stdout.find('tacker') != -1 and inventory_hostname == haproxy_hosts.keys()[0] + shell: | + . /opt/admin-openrc.sh; + openstack service delete tacker; + when: service_info.stdout.find('tacker') != -1 + and inventory_hostname == haproxy_hosts.keys()[0] - name: delete the existed tacker user - shell: . /opt/admin-openrc.sh; openstack user delete tacker - when: user_info.stdout.find('tacker') != -1 and inventory_hostname == haproxy_hosts.keys()[0] + shell: | + . /opt/admin-openrc.sh; + openstack user delete tacker; + when: user_info.stdout.find('tacker') != -1 + and inventory_hostname == haproxy_hosts.keys()[0] - name: create tacker user with admin privileges - shell: . /opt/admin-openrc.sh; openstack user create --password console tacker; openstack role add --project service --user tacker admin; + shell: | + . /opt/admin-openrc.sh; + openstack user create --password console tacker; + openstack role add --project service --user tacker admin; when: inventory_hostname == haproxy_hosts.keys()[0] - name: creat tacker service - shell: > - . /opt/admin-openrc.sh; openstack service create --name tacker --description "Tacker Project" nfv-orchestration + shell: | + . /opt/admin-openrc.sh; + openstack service create --name tacker \ + --description "Tacker Project" nfv-orchestration when: inventory_hostname == haproxy_hosts.keys()[0] - name: provide an endpoint to tacker service - shell: > - . /opt/admin-openrc.sh; openstack endpoint create --region RegionOne \ + shell: | + . /opt/admin-openrc.sh; \ + openstack endpoint create --region RegionOne \ --publicurl 'http://{{ public_vip.ip }}:8888/' \ --adminurl 'http://{{ internal_vip.ip }}:8888/' \ --internalurl 'http://{{ internal_vip.ip }}:8888/' tacker @@ -115,18 +145,16 @@ pip: name=Babel state=present version=2.3.4 - name: install pip packages - shell: > + shell: | pip install tosca-parser heat-translator oslosphinx; - name: install tacker - shell: > + shell: | . /opt/admin-openrc.sh; cd {{ tacker_home }}; python setup.py install - name: create 'tacker' directory in '/var/cache', set ownership and permissions - shell: > + shell: | mkdir -p /var/cache/tacker -# sudo chown <LOGIN_USER>:root /var/cache/tacker -# chmod 700 /var/cache/tacker - name: create 'tacker' directory in '/var/log' shell: mkdir -p /var/log/tacker @@ -136,30 +164,40 @@ with_items: "{{ tacker_configs_templates }}" - name: edit tacker configuration file - shell: crudini --merge /usr/local/etc/tacker/tacker.conf < /opt/os_templates/tacker.j2 + shell: | + crudini --merge /usr/local/etc/tacker/tacker.conf \ + < /opt/os_templates/tacker.j2 - name: populate tacker database - shell: > - . /opt/admin-openrc.sh; /usr/local/bin/tacker-db-manage --config-file /usr/local/etc/tacker/tacker.conf upgrade head + shell: | + . /opt/admin-openrc.sh; \ + /usr/local/bin/tacker-db-manage \ + --config-file /usr/local/etc/tacker/tacker.conf upgrade head when: inventory_hostname == haproxy_hosts.keys()[0] - name: install tacker client - shell: > - . /opt/admin-openrc.sh; cd {{ tacker_client_home }}; python setup.py install + shell: | + . /opt/admin-openrc.sh; cd {{ tacker_client_home }}; + python setup.py install - name: install tacker horizon - shell: > - . /opt/admin-openrc.sh; cd {{ tacker_horizon_home }}; python setup.py install + shell: | + . /opt/admin-openrc.sh; cd {{ tacker_horizon_home }}; + python setup.py install - name: enable tacker horizon in dashboard - shell: > - cp {{ tacker_horizon_home }}/openstack_dashboard_extensions/* /usr/share/openstack-dashboard/openstack_dashboard/enabled/ + shell: | + cp {{ tacker_horizon_home }}/openstack_dashboard_extensions/* \ + /usr/share/openstack-dashboard/openstack_dashboard/enabled/ - name: restart apache server shell: service apache2 restart - name: launch tacker-server - shell: > - . /opt/admin-openrc.sh; python /usr/local/bin/tacker-server --config-file /usr/local/etc/tacker/tacker.conf --log-file /var/log/tacker/tacker.log + shell: | + . /opt/admin-openrc.sh; \ + python /usr/local/bin/tacker-server \ + --config-file /usr/local/etc/tacker/tacker.conf | + --log-file /var/log/tacker/tacker.log async: 9999999999999 poll: 0 diff --git a/deploy/adapters/ansible/roles/tacker/vars/main.yml b/deploy/adapters/ansible/roles/tacker/vars/main.yml index 0ae6d9ef..601f3721 100755 --- a/deploy/adapters/ansible/roles/tacker/vars/main.yml +++ b/deploy/adapters/ansible/roles/tacker/vars/main.yml @@ -1,3 +1,4 @@ +--- ############################################################################## # Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. # |