Skip to content

Commit

Permalink
Merge "Optimize the code"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Dec 13, 2016
2 parents e1e73ac + 49c0ca3 commit d91ed21
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions ansible/roles/baremetal/tasks/post-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
become: True
when:
- ansible_distribution == "Ubuntu"
- apparmor_libvirtd_profile.stat.exists == True
- apparmor_libvirtd_profile.stat.exists | bool

- name: Create docker group
group:
Expand All @@ -57,29 +57,29 @@
append: yes
groups: docker
become: True
when: create_kolla_user | bool == True
when: create_kolla_user | bool

- name: Start docker
service:
name: docker
state: started
become: yes
become: True

- name: Restart docker
service:
name: docker
state: restarted
become: yes
become: True

- name: Enable docker
service:
name: docker
enabled: yes
become: yes
become: True

- name: Reboot
command: reboot -f
become: yes
become: True
when:
- reboot_required is defined
- reboot_required | bool == true
- reboot_required | bool
16 changes: 8 additions & 8 deletions ansible/roles/baremetal/tasks/pre-install.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# NOTE: raw install is required to support cloud images which do not have python installed
- name: "Install python2 and python-simplejson"
become: true
become: True
raw: "yum install -y python python-simplejson || (apt-get update && apt-get install -y python2.7 python-simplejson)"

- name: Gather facts
Expand All @@ -14,7 +14,7 @@
line: "127.0.0.1 localhost"
state: present
become: True
when: customize_etc_hosts | bool == True
when: customize_etc_hosts | bool

- name: Generate /etc/hosts for all of the nodes
blockinfile:
Expand All @@ -25,7 +25,7 @@
{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
{% endfor %}
become: True
when: customize_etc_hosts | bool == True
when: customize_etc_hosts | bool

- name: Ensure sudo group is present
group: name=sudo state=present
Expand All @@ -34,7 +34,7 @@
- name: Ensure kolla group is present
group: name=kolla state=present
become: True
when: create_kolla_user | bool == True
when: create_kolla_user | bool

- name: Create kolla user
user:
Expand All @@ -43,7 +43,7 @@
group: kolla
groups: "sudo"
become: True
when: create_kolla_user | bool == True
when: create_kolla_user | bool

- name: Grant kolla user passwordless sudo
lineinfile:
Expand All @@ -52,14 +52,14 @@
regexp: '^kolla'
line: 'kolla ALL=(ALL) NOPASSWD: ALL'
become: True
when: create_kolla_user | bool == True
when: create_kolla_user | bool

- name: Add public key to kolla user authorized keys
authorized_key:
user: kolla
key: "{{ kolla_ssh_key.public_key }}"
become: True
when: create_kolla_user | bool == True
when: create_kolla_user | bool

- name: Install apt packages
command: apt-get update
Expand Down Expand Up @@ -125,7 +125,7 @@
group: kolla
mode: 0755
become: True
when: create_kolla_user | bool == True
when: create_kolla_user | bool

- name: Ensure /etc/kolla directory exists
file:
Expand Down

0 comments on commit d91ed21

Please sign in to comment.