summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/common/tasks
diff options
context:
space:
mode:
authorbaigk <baiguoku@huawei.com>2015-11-03 17:56:18 -0800
committerbaigk <baiguoku@huawei.com>2015-11-13 16:52:46 +0000
commit5ea122af37945bf6d9912e44eccb0322db109805 (patch)
tree87853e6589af643708ce9eaff6c859509ea869a5 /deploy/adapters/ansible/roles/common/tasks
parente21f4641344faa6d61e5f0f772662d9185a34b18 (diff)
first update the hosts file to speed up the installation
JIRA: COMPASS-135 Change-Id: I364d43b999896c7cccb5222a166588d86463e50c 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.yml34
1 files changed, 16 insertions, 18 deletions
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