From 819912d0379f6cd2b2693c2968576f7514a117c5 Mon Sep 17 00:00:00 2001 From: liyuenan Date: Mon, 19 Dec 2016 11:06:36 +0800 Subject: master only support newton JIRA: COMPASS-513 Remove other roles and ppa, master only support newton. Change-Id: I47ddb16baa25902c3e05cc7f9d0d6430f5dc7e00 Signed-off-by: liyuenan --- .../roles/swift/tasks/main.yml | 11 --- .../roles/swift/tasks/swift-compute1.yml | 80 ------------------- .../roles/swift/tasks/swift-controller1.yml | 34 -------- .../roles/swift/tasks/swift-controller2.yml | 93 ---------------------- .../roles/swift/tasks/swift.yml | 79 ------------------ 5 files changed, 297 deletions(-) delete mode 100644 deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/main.yml delete mode 100644 deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-compute1.yml delete mode 100644 deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller1.yml delete mode 100644 deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller2.yml delete mode 100644 deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift.yml (limited to 'deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks') diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/main.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/main.yml deleted file mode 100644 index 0f083146..00000000 --- a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/main.yml +++ /dev/null @@ -1,11 +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 -############################################################################## ---- -- include: swift.yml - when: moon == "Enable" diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-compute1.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-compute1.yml deleted file mode 100644 index be00484b..00000000 --- a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-compute1.yml +++ /dev/null @@ -1,80 +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: disable auto start - copy: - content: "#!/bin/sh\nexit 101" - dest: "/usr/sbin/policy-rc.d" - mode: 0755 - when: ansible_os_family == "Debian" - -- name: install swift-compute packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" - with_items: compute_packages | union(compute_packages_noarch) - -- name: enable auto start - file: - path=/usr/sbin/policy-rc.d - state=absent - when: ansible_os_family == "Debian" - -- name: format devices - shell: > - dd if=/dev/zero of=/var/swift1 bs=1G count=10; - dd if=/dev/zero of=/var/swift2 bs=1G count=10; - mkfs.xfs /var/swift1; - mkfs.xfs /var/swift2; - -- name: create mount point dirertory - shell: > - mkdir -p /srv/node/swift1; - mkdir -p /srv/node/swift2; - -- name: edit /etc/fstab - shell: > - echo "/var/swift1 /srv/node/swift1/ xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab; - echo "/var/swift2 /srv/node/swift2/ xfs noatime,nodiratime,nobarrier,logbufs=8 0 2" >> /etc/fstab; - mount /srv/node/swift1; - mount /srv/node/swift2; - -- name: edit /etc/default/rsync - shell: sed -i 's/RSYNC_ENABLE=false/RSYNC_ENABLE=true/g' /etc/default/rsync - -- name: restart rsync service - service: name=rsync state=restarted enabled=yes - -- name: copy scripts - template: src={{ item }} dest=/etc/swift/ backup=yes - with_items: - - account-server.conf - - container-server.conf - - object-server.conf - -- name: change directory - shell: > - chown -R swift:swift /srv/node; - mkdir -p /var/cache/swift; - chown -R root:swift /var/cache/swift; - chmod -R 775 /var/cache/swift; - -#- name: copy swift lib -# copy: src=swift-lib.tar.gz dest=/tmp/swift-lib.tar.gz -# -#- name: upload swift lib -# unarchive: src=swift-lib.tar.gz dest=/tmp/ -# -#- name: copy swift lib -# shell: command: su -s /bin/sh -c "cp /tmp/swift-lib/* /usr/lib/" -# -#- name: untar swift lib -# shell: > -# tar zxf /tmp/swift-lib.tar.gz; -# cp /tmp/swift-lib/* /usr/lib/; - diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller1.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller1.yml deleted file mode 100644 index 36d05040..00000000 --- a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller1.yml +++ /dev/null @@ -1,34 +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: disable auto start - copy: - content: "#!/bin/sh\nexit 101" - dest: "/usr/sbin/policy-rc.d" - mode: 0755 - when: ansible_os_family == "Debian" - -- name: install swift-controllor packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" - with_items: controller_packages | union(controller_packages_noarch) - -- name: enable auto start - file: - path=/usr/sbin/policy-rc.d - state=absent - when: ansible_os_family == "Debian" - -- name: make swift directory - file: path=/etc/swift state=directory mode=0755 - -- name: update proxy-server conf - template: src=proxy-server.conf dest=/etc/swift/proxy-server.conf backup=yes - - diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller2.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller2.yml deleted file mode 100644 index 92d4ab22..00000000 --- a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift-controller2.yml +++ /dev/null @@ -1,93 +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: create account.builder file - shell: > - cd /etc/swift ; - swift-ring-builder account.builder create 10 3 1; - -- name: add each storage node to the ring - shell: > - cd /etc/swift; - swift-ring-builder account.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6002 --device swift1 --weight 100 ; - swift-ring-builder account.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6002 --device swift2 --weight 100 ; - with_indexed_items: groups['compute'] - -- name: verify the ring contents 1 - shell: > - cd /etc/swift; - swift-ring-builder account.builder; - -- name: rebalance the ring - shell: > - cd /etc/swift; - swift-ring-builder account.builder rebalance; - - -##################### -- name: create contrainer builder file - shell: > - cd /etc/swift; - swift-ring-builder container.builder create 10 3 1; - -- name: add each storage node to the ring - shell: > - cd /etc/swift; - swift-ring-builder container.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6001 --device swift1 --weight 100; - swift-ring-builder container.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6001 --device swift2 --weight 100; - with_indexed_items: groups['compute'] - -- name: verify the ring contents 2 - shell: > - cd /etc/swift; - swift-ring-builder container.builder; - -- name: rebalance the ring - shell: > - cd /etc/swift; - swift-ring-builder container.builder rebalance; - -############################# - -- name: create object builder file - shell: > - cd /etc/swift; - swift-ring-builder object.builder create 10 3 1; - -- name: add each storage node to the ring - shell: > - cd /etc/swift; - swift-ring-builder object.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6000 --device swift1 --weight 100; - swift-ring-builder object.builder add --region 1 --zone 1 --ip {{ ip_settings[item.1]['mgmt']['ip'] }} --port 6000 --device swift2 --weight 100; - with_indexed_items: groups['compute'] - -- name: verify the ring contents - shell: > - cd /etc/swift; - swift-ring-builder object.builder; - -- name: rebalance the ring - shell: > - cd /etc/swift; - swift-ring-builder object.builder rebalance; - -########################## - -- name: distribute ring configuration files to the other controller - shell: > - cd /etc/swift; - scp account.ring.gz container.ring.gz object.ring.gz root@{{ ip_settings[item.1]['mgmt']['ip'] }}:/etc/swift/; - with_indexed_items: groups['controller'] - -- name: distribute ring configuration files to the all compute - shell: > - cd /etc/swift; - scp account.ring.gz container.ring.gz object.ring.gz root@{{ ip_settings[item.1]['mgmt']['ip'] }}:/etc/swift/; - with_indexed_items: groups['compute'] diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift.yml deleted file mode 100644 index 4e2651a7..00000000 --- a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/tasks/swift.yml +++ /dev/null @@ -1,79 +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 -############################################################################## ---- -- include_vars: "{{ ansible_os_family }}.yml" - -- include: swift-controller1.yml - when: inventory_hostname in groups['controller'] - -- include: swift-compute1.yml - when: inventory_hostname in groups['compute'] - -- include: swift-controller2.yml - when: inventory_hostname == haproxy_hosts.keys()[0] - -- name: copy swift.conf - template: src=swift.conf dest=/etc/swift/swift.conf backup=yes - -- name: chown /etc/swift - shell: chown -R root:swift /etc/swift - -- name: restart tasks on controller - service: name={{ item }} state=restarted enabled=yes - with_items: - - memcached - - swift-proxy - when: inventory_hostname in groups['controller'] - -- name: restart tasks on compute - shell: swift-init all start - when: inventory_hostname in groups['compute'] - ignore_errors: True - -- name: restart tasks on controller - service: name={{ item }} state=restarted enabled=yes - with_items: - - rsync - when: inventory_hostname in groups['compute'] - -- name: upload swift lib - unarchive: src=swift-lib.tar.gz dest=/tmp/ - -- name: copy swift lib - command: su -s /bin/sh -c "cp /tmp/swift-lib/* /usr/lib/" - -- name: wait 30 seconds - shell: sleep 30 - -- name: create swift task script - shell: echo {{ item }} >> /opt/swift-service - with_items: - - swift-account - - swift-account-replicator - - swift-container-replicator - - swift-object - - swift-object-updater - - swift-account-auditor - - swift-container - - swift-container-sync - - swift-object-auditor - - swift-account-reaper - - swift-container-auditor - - swift-container-updater - - swift-object-replicator - when: inventory_hostname in groups['compute'] - ignore_errors: True - -- name: restart swift task - shell: > - for i in `cat /opt/swift-service`; do service $i start; done; - sleep 10; - for i in `cat /opt/swift-service`; do service $i restart; done; - when: inventory_hostname in groups['compute'] - ignore_errors: True -- cgit 1.2.3-korg