Skip to content
Snippets Groups Projects
Commit d91ed21f authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Optimize the code"

parents e1e73ac5 49c0ca3a
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
become: True become: True
when: when:
- ansible_distribution == "Ubuntu" - ansible_distribution == "Ubuntu"
- apparmor_libvirtd_profile.stat.exists == True - apparmor_libvirtd_profile.stat.exists | bool
- name: Create docker group - name: Create docker group
group: group:
...@@ -57,29 +57,29 @@ ...@@ -57,29 +57,29 @@
append: yes append: yes
groups: docker groups: docker
become: True become: True
when: create_kolla_user | bool == True when: create_kolla_user | bool
- name: Start docker - name: Start docker
service: service:
name: docker name: docker
state: started state: started
become: yes become: True
- name: Restart docker - name: Restart docker
service: service:
name: docker name: docker
state: restarted state: restarted
become: yes become: True
- name: Enable docker - name: Enable docker
service: service:
name: docker name: docker
enabled: yes enabled: yes
become: yes become: True
- name: Reboot - name: Reboot
command: reboot -f command: reboot -f
become: yes become: True
when: when:
- reboot_required is defined - reboot_required is defined
- reboot_required | bool == true - reboot_required | bool
--- ---
# NOTE: raw install is required to support cloud images which do not have python installed # NOTE: raw install is required to support cloud images which do not have python installed
- name: "Install python2 and python-simplejson" - 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)" raw: "yum install -y python python-simplejson || (apt-get update && apt-get install -y python2.7 python-simplejson)"
- name: Gather facts - name: Gather facts
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
line: "127.0.0.1 localhost" line: "127.0.0.1 localhost"
state: present state: present
become: True become: True
when: customize_etc_hosts | bool == True when: customize_etc_hosts | bool
- name: Generate /etc/hosts for all of the nodes - name: Generate /etc/hosts for all of the nodes
blockinfile: blockinfile:
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }} {{ hostvars[host]['ansible_hostname'] }}
{% endfor %} {% endfor %}
become: True become: True
when: customize_etc_hosts | bool == True when: customize_etc_hosts | bool
- name: Ensure sudo group is present - name: Ensure sudo group is present
group: name=sudo state=present group: name=sudo state=present
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
- name: Ensure kolla group is present - name: Ensure kolla group is present
group: name=kolla state=present group: name=kolla state=present
become: True become: True
when: create_kolla_user | bool == True when: create_kolla_user | bool
- name: Create kolla user - name: Create kolla user
user: user:
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
group: kolla group: kolla
groups: "sudo" groups: "sudo"
become: True become: True
when: create_kolla_user | bool == True when: create_kolla_user | bool
- name: Grant kolla user passwordless sudo - name: Grant kolla user passwordless sudo
lineinfile: lineinfile:
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
regexp: '^kolla' regexp: '^kolla'
line: 'kolla ALL=(ALL) NOPASSWD: ALL' line: 'kolla ALL=(ALL) NOPASSWD: ALL'
become: True become: True
when: create_kolla_user | bool == True when: create_kolla_user | bool
- name: Add public key to kolla user authorized keys - name: Add public key to kolla user authorized keys
authorized_key: authorized_key:
user: kolla user: kolla
key: "{{ kolla_ssh_key.public_key }}" key: "{{ kolla_ssh_key.public_key }}"
become: True become: True
when: create_kolla_user | bool == True when: create_kolla_user | bool
- name: Install apt packages - name: Install apt packages
command: apt-get update command: apt-get update
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
group: kolla group: kolla
mode: 0755 mode: 0755
become: True become: True
when: create_kolla_user | bool == True when: create_kolla_user | bool
- name: Ensure /etc/kolla directory exists - name: Ensure /etc/kolla directory exists
file: file:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment