Commit cfd58e1f by John Eskew

Fix with_items

parent 3debac48
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
fail: fail:
msg: "Configuration Sources Checking (COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING) is enabled, you must define {{ item }}" msg: "Configuration Sources Checking (COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING) is enabled, you must define {{ item }}"
when: COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING and ({{ item }} is not defined or {{ item }} != True) when: COMMON_EXTRA_CONFIGURATION_SOURCES_CHECKING and ({{ item }} is not defined or {{ item }} != True)
with_items: COMMON_EXTRA_CONFIGURATION_SOURCES with_items: "{{ COMMON_EXTRA_CONFIGURATION_SOURCES }}"
tags: tags:
- "install" - "install"
- "install:configuration" - "install:configuration"
# ubuntu # ubuntu
- stat: - stat:
path: "/usr/sbin/update-ca-certificates" path: "/usr/sbin/update-ca-certificates"
register: update_ca_certificates register: update_ca_certificates
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
apt: apt:
name: "{{ item }}" name: "{{ item }}"
install_recommends: yes install_recommends: yes
state: present state: present
update_cache: yes update_cache: yes
with_items: "{{ common_debian_pkgs }}" with_items: "{{ common_debian_pkgs }}"
when: ansible_distribution in common_debian_variants when: ansible_distribution in common_debian_variants
...@@ -91,13 +91,13 @@ ...@@ -91,13 +91,13 @@
update_cache: yes update_cache: yes
with_items: "{{ common_custom_debian_pkgs }}" with_items: "{{ common_custom_debian_pkgs }}"
when: > when: >
ansible_distribution in common_debian_variants and ansible_distribution in common_debian_variants and
ansible_distribution_release in common_custom_ppa_releases ansible_distribution_release in common_custom_ppa_releases
- name: Install role-independent useful system packages - name: Install role-independent useful system packages
yum: yum:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
update_cache: yes update_cache: yes
with_items: "{{ common_redhat_pkgs }}" with_items: "{{ common_redhat_pkgs }}"
when: ansible_distribution in common_redhat_variants when: ansible_distribution in common_redhat_variants
...@@ -106,24 +106,24 @@ ...@@ -106,24 +106,24 @@
- name: Create common directories - name: Create common directories
file: file:
path: "{{ item.path }}" path: "{{ item.path }}"
state: "{{ item.state | default('directory') }}" state: "{{ item.state | default('directory') }}"
owner: "{{ item.owner | default('root') }}" owner: "{{ item.owner | default('root') }}"
group: "{{ item.group | default('root') }}" group: "{{ item.group | default('root') }}"
mode: "0755" mode: "0755"
with_items: "{{ common_directories }}" with_items: "{{ common_directories }}"
- name: upload sudo config for key forwarding as root - name: upload sudo config for key forwarding as root
copy: copy:
src: ssh_key_forward src: ssh_key_forward
dest: /etc/sudoers.d/ssh_key_forward dest: /etc/sudoers.d/ssh_key_forward
validate: 'visudo -c -f %s' validate: 'visudo -c -f %s'
owner: root owner: root
group: root group: root
mode: "0440" mode: "0440"
- name: pip install virtualenv - name: pip install virtualenv
pip: pip:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}" extra_args: "-i {{ COMMON_PYPI_MIRROR_URL }}"
with_items: "{{ common_pip_pkgs }}" with_items: "{{ common_pip_pkgs }}"
...@@ -131,8 +131,8 @@ ...@@ -131,8 +131,8 @@
- name: update /etc/hosts - name: update /etc/hosts
template: template:
src: hosts.j2 src: hosts.j2
dest: /etc/hosts dest: /etc/hosts
when: COMMON_HOSTNAME|length > 0 when: COMMON_HOSTNAME|length > 0
register: etc_hosts register: etc_hosts
...@@ -152,8 +152,8 @@ ...@@ -152,8 +152,8 @@
template: template:
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
src: "{{ item.src }}" src: "{{ item.src }}"
owner: root owner: root
group: root group: root
mode: "{{ item.mode | default(0644) }}" mode: "{{ item.mode | default(0644) }}"
register: config_templates register: config_templates
with_items: with_items:
...@@ -165,8 +165,8 @@ ...@@ -165,8 +165,8 @@
# TODO: restarts no matter which template has changed, need to examine # TODO: restarts no matter which template has changed, need to examine
# the results # the results
- name: restart rsyslogd - name: restart rsyslogd
service: service:
name: rsyslog name: rsyslog
state: restarted state: restarted
become: True become: True
when: config_templates.changed when: config_templates.changed
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment