yamllint fixes

This commit is contained in:
2022-04-03 13:20:47 +12:00
parent 4b41ea1a10
commit 8925c556d6
8 changed files with 54 additions and 46 deletions

View File

@@ -10,22 +10,25 @@
notify: Restart Postfix notify: Restart Postfix
when: "'SMTP0' not in inventory_hostname" when: "'SMTP0' not in inventory_hostname"
with_items: with_items:
- { dest: /etc/postfix/main.cf, - {
dest: /etc/postfix/main.cf,
regexp: "^.?inet_protocols =", regexp: "^.?inet_protocols =",
line: "inet_protocols = ipv4" line: "inet_protocols = ipv4",
} }
- { dest: /etc/postfix/main.cf, - {
dest: /etc/postfix/main.cf,
regexp: "^.?inet_interfaces =", regexp: "^.?inet_interfaces =",
line: "inet_interfaces = all" line: "inet_interfaces = all",
} }
- { dest: /etc/postfix/main.cf, - {
dest: /etc/postfix/main.cf,
regexp: "^.?relayhost =", regexp: "^.?relayhost =",
line: "relayhost = {{ relayhost }}" line: "relayhost = {{ relayhost }}",
} }
- { - {
dest: /etc/postfix/main.cf, dest: /etc/postfix/main.cf,
regexp: "^.?smtp_randomize_addresses =", regexp: "^.?smtp_randomize_addresses =",
line: "smtp_randomize_addresses = no" line: "smtp_randomize_addresses = no",
} }
- name: postfix | Ensure Postfix is Started/Enabled - name: postfix | Ensure Postfix is Started/Enabled

View File

@@ -1,9 +1,9 @@
--- ---
- name: Include tasks only if one of the files exist, otherwise skip the task - name: Include tasks only if one of the files exist, otherwise skip the task
include_tasks: '{{ item }}' include_tasks: "{{ item }}"
vars: vars:
params: params:
files: files:
- '{{ ansible_os_family }}.yml' - "{{ ansible_os_family }}.yml"
- 'common.yml' - "common.yml"
loop: "{{ q('first_found', params, errors='ignore') }}" loop: "{{ q('first_found', params, errors='ignore') }}"

View File

@@ -6,14 +6,13 @@
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
backup: yes backup: yes
with_items: with_items:
- { src: etc.sysconfig.network.j2, - {
src: etc.sysconfig.network.j2,
dest: /etc/sysconfig/network, dest: /etc/sysconfig/network,
mode: u+rw, a+r mode: u+rw,
} a+r,
- { src: etc.resolv.conf.j2,
dest: /etc/resolv.conf,
mode: u+rw, a+r
} }
- { src: etc.resolv.conf.j2, dest: /etc/resolv.conf, mode: u+rw, a+r }
when: ansible_virtualization_type != "docker" when: ansible_virtualization_type != "docker"
tags: dns tags: dns
@@ -25,23 +24,29 @@
backrefs: yes backrefs: yes
backup: yes backup: yes
with_items: with_items:
- {regexp: "^127.0.0.1.+localdomain4$", - {
line: "127.0.0.1 localhost {{ inventory_hostname }}" regexp: "^127.0.0.1.+localdomain4$",
line: "127.0.0.1 localhost {{ inventory_hostname }}",
} }
- {regexp: "^::1.+localdomain6$", - {
line: "::1 localhost {{ inventory_hostname }}" regexp: "^::1.+localdomain6$",
line: "::1 localhost {{ inventory_hostname }}",
} }
- {regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_default_ipv4.address.split('.')[-1] }}$", - {
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }}.{{ domain }} {{ inventory_hostname }}" regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_default_ipv4.address.split('.')[-1] }}$",
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }}.{{ domain }} {{ inventory_hostname }}",
} }
- {regexp: "^127.0.0.1.+{{ ansible_nodename.split('.')[0] }}$", - {
line: "127.0.0.1 localhost {{ inventory_hostname }}" regexp: "^127.0.0.1.+{{ ansible_nodename.split('.')[0] }}$",
line: "127.0.0.1 localhost {{ inventory_hostname }}",
} }
- {regexp: "^::1.+{{ ansible_nodename.split('.')[0] }}$", - {
line: "::1 localhost {{ inventory_hostname }}" regexp: "^::1.+{{ ansible_nodename.split('.')[0] }}$",
line: "::1 localhost {{ inventory_hostname }}",
} }
- {regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_nodename.split('.')[0] }}$", - {
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }}.{{ domain }} {{ inventory_hostname }}" regexp: "^{{ ansible_default_ipv4.address }}.*{{ ansible_nodename.split('.')[0] }}$",
line: "{{ ansible_default_ipv4.address }} {{ inventory_hostname }}.{{ domain }} {{ inventory_hostname }}",
} }
when: ansible_virtualization_type != "docker" when: ansible_virtualization_type != "docker"