aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2015-11-16 06:49:51 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2015-11-16 06:49:51 +0000
commite28554faea569b5e6d15b3816df702e664b5bba4 (patch)
treed93dccf4103101a49260ff4517932696dae4a14a /deploy/adapters/ansible/roles
parent481ce72c96a61dd55276805a28890910779dcf47 (diff)
parent5ea122af37945bf6d9912e44eccb0322db109805 (diff)
Merge "first update the hosts file to speed up the installation"
Diffstat (limited to 'deploy/adapters/ansible/roles')
-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