diff options
author | baigk <baiguoku@huawei.com> | 2015-08-06 02:37:33 -0400 |
---|---|---|
committer | baigk <baiguoku@huawei.com> | 2015-08-09 22:47:56 -0400 |
commit | 87612abc0e24cafd89a49e350165b08fe1608233 (patch) | |
tree | 07b156c0268fd189f92e8a0730118edc51b8073f /deploy/adapters/ansible/roles/common/tasks | |
parent | 5aedf594112c0749b6e9039d15b9fe70d210a942 (diff) |
support deployment openstack juno with ansible for compass in centos7.1
JIRA: COMPASS-6
Change-Id: I8ef865e8acfe29c3ff5c7e9030e4cebabed3457b
Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/common/tasks')
-rw-r--r-- | deploy/adapters/ansible/roles/common/tasks/main.yml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/deploy/adapters/ansible/roles/common/tasks/main.yml b/deploy/adapters/ansible/roles/common/tasks/main.yml index 452f7683..1b20c0fd 100644 --- a/deploy/adapters/ansible/roles/common/tasks/main.yml +++ b/deploy/adapters/ansible/roles/common/tasks/main.yml @@ -2,11 +2,11 @@ - include_vars: "{{ ansible_os_family }}.yml" - name: first update pkgs - apt: update_cache=yes + shell: "{{ ansible_pkg_mgr }} update" - name: install packages action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest" - with_items: packages + with_items: packages | union(packages_noarch) - name: update hosts files to all hosts template: src=hosts @@ -21,8 +21,10 @@ shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf register: ip -- name: update compass-core name and ip to hosts files - shell: echo "# compass\n"{{ ip.stdout_lines[0] }} {{ name.stdout_lines[0] }} >> /etc/hosts +- name: update compass-core name and ip to hosts files + shell: | + echo "# compass" >> /etc/hosts + echo {{ ip.stdout_lines[0] }} {{ name.stdout_lines[0] }} >> /etc/hosts - name: create pip config directory file: path=~/.pip state=directory @@ -34,12 +36,12 @@ - name: update pip.conf template: src=pip.conf dest=~/.pip/pip.conf -- name: restart ntp - command: su -s /bin/sh -c "service ntp stop; ntpd -gq; hwclock --systohc" +- name: sync between sys clock and hard clock + command: su -s /bin/sh -c "service {{ ntp_service }} stop; ntpd -gq; hwclock --systohc" ignore_errors: True - name: update ntp conf template: src=ntp.conf dest=/etc/ntp.conf backup=yes - name: restart ntp - service: name=ntp state=restarted enabled=yes + service: name={{ ntp_service }} state=restarted enabled=yes |