From 5ea122af37945bf6d9912e44eccb0322db109805 Mon Sep 17 00:00:00 2001 From: baigk Date: Tue, 3 Nov 2015 17:56:18 -0800 Subject: first update the hosts file to speed up the installation JIRA: COMPASS-135 Change-Id: I364d43b999896c7cccb5222a166588d86463e50c Signed-off-by: baigk --- .../adapters/ansible/roles/common/tasks/main.yml | 34 ++++++++++------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'deploy') diff --git a/deploy/adapters/ansible/roles/common/tasks/main.yml b/deploy/adapters/ansible/roles/common/tasks/main.yml index 0b72d6e2..04a18a83 100644 --- a/deploy/adapters/ansible/roles/common/tasks/main.yml +++ b/deploy/adapters/ansible/roles/common/tasks/main.yml @@ -1,20 +1,12 @@ --- - include_vars: "{{ ansible_os_family }}.yml" -- name: first update pkgs - shell: "{{ ansible_pkg_mgr }} update" - -- name: install packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest" - with_items: packages | union(packages_noarch) +- name: speed up ansible by purging landscape-common + apt: pkg=landscape-common state=absent purge=yes + when: ansible_os_family == "Debian" - name: update hosts files to all hosts - template: src=hosts - dest=/etc/hosts - backup=yes - -- name: make config template dir exist - file: path=/opt/os_templates state=directory mode=0755 + template: src=hosts dest=/etc/hosts backup=yes - name: get compass-core hostname local_action: shell hostname @@ -22,20 +14,26 @@ - name: get compass-core addr shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf - register: ip + register: COMPASS_SERVER - 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 + echo {{ COMPASS_SERVER.stdout_lines[0] }} {{ name.stdout_lines[0] }} >> /etc/hosts + +- name: first update pkgs + shell: "{{ ansible_pkg_mgr }} update" + +- name: install packages + action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest" + with_items: packages | union(packages_noarch) + +- name: make config template dir exist + file: path=/opt/os_templates state=directory mode=0755 - name: create pip config directory file: path=~/.pip state=directory -- name: get pip source server addr - shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf - register: COMPASS_SERVER - - name: update pip.conf template: src=pip.conf dest=~/.pip/pip.conf -- cgit 1.2.3-korg