Catching up config with known state
This commit is contained in:
parent
be2908625d
commit
633f231b26
@ -27,6 +27,13 @@
|
|||||||
group: ircd
|
group: ircd
|
||||||
mode: 0640
|
mode: 0640
|
||||||
|
|
||||||
|
- name: Add ircd user to ssl
|
||||||
|
become: yes
|
||||||
|
user:
|
||||||
|
name: ircd
|
||||||
|
groups: ssl
|
||||||
|
append: yes
|
||||||
|
|
||||||
- name: Copy service file
|
- name: Copy service file
|
||||||
become: yes
|
become: yes
|
||||||
register: servicesfile
|
register: servicesfile
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
pingfreq="120"
|
pingfreq="120"
|
||||||
port="6697"
|
port="6697"
|
||||||
recvq="8192"
|
recvq="8192"
|
||||||
requiressl="on"
|
requiressl="off"
|
||||||
resolvehostnames="on"
|
resolvehostnames="on"
|
||||||
softsendq="8192"
|
softsendq="8192"
|
||||||
threshold="25"
|
threshold="25"
|
||||||
|
@ -9,35 +9,35 @@
|
|||||||
|
|
||||||
- name: Static ArchLinux network config
|
- name: Static ArchLinux network config
|
||||||
become: yes
|
become: yes
|
||||||
when: static and not tap
|
when: static is defined and not tap is defined
|
||||||
template:
|
template:
|
||||||
src: netctl-static.j2
|
src: netctl-static.j2
|
||||||
dest: "/etc/netctl/{{ ipinterface }}"
|
dest: "/etc/netctl/{{ ipinterface }}"
|
||||||
|
|
||||||
- name: Tap ArchLinux network config
|
- name: Tap ArchLinux network config
|
||||||
become: yes
|
become: yes
|
||||||
when: tap and not static
|
when: tap is defined and not static is defined
|
||||||
template:
|
template:
|
||||||
src: netctl-tap.j2
|
src: netctl-tap is defined.j2
|
||||||
dest: "/etc/netctl/{{ ipinterface }}"
|
dest: "/etc/netctl/{{ ipinterface }}"
|
||||||
|
|
||||||
- name: Bridge ArchLinux network config
|
- name: Bridge ArchLinux network config
|
||||||
become: yes
|
become: yes
|
||||||
when: tap and not static
|
when: tap is defined and not static is defined
|
||||||
template:
|
template:
|
||||||
src: netctl-bond.j2
|
src: netctl-bond.j2
|
||||||
dest: "/etc/netctl/br0"
|
dest: "/etc/netctl/br0"
|
||||||
|
|
||||||
- name: Tunnel ArchLinux network config
|
- name: Tunnel ArchLinux network config
|
||||||
become: yes
|
become: yes
|
||||||
when: tap and not static
|
when: tap is defined and not static is defined
|
||||||
copy:
|
copy:
|
||||||
src: netctl-tun
|
src: netctl-tun
|
||||||
dest: "/etc/netctl/tun0"
|
dest: "/etc/netctl/tun0"
|
||||||
|
|
||||||
- name: Dynamic ArchLinux network config
|
- name: Dynamic ArchLinux network config
|
||||||
become: yes
|
become: yes
|
||||||
when: not static and not tap
|
when: not static is defined and not tap is defined
|
||||||
template:
|
template:
|
||||||
src: netctl-dhcp.j2
|
src: netctl-dhcp.j2
|
||||||
dest: "/etc/netctl/{{ ipinterface }}"
|
dest: "/etc/netctl/{{ ipinterface }}"
|
||||||
|
@ -3,6 +3,33 @@
|
|||||||
# This role installs the basic package and host setup for AniNIX operations.
|
# This role installs the basic package and host setup for AniNIX operations.
|
||||||
|
|
||||||
# This is an AniNIX convention to allow password management by Ansible.
|
# This is an AniNIX convention to allow password management by Ansible.
|
||||||
|
|
||||||
|
- name: Test root password
|
||||||
|
ignore_errors: yes
|
||||||
|
register: root_password_test
|
||||||
|
vars:
|
||||||
|
ansible_become_user: "{{ item }}"
|
||||||
|
ansible_become_method: su
|
||||||
|
ansible_become_password: "{{ passwords[inventory_hostname] }}"
|
||||||
|
become: yes
|
||||||
|
command: id
|
||||||
|
loop:
|
||||||
|
- root
|
||||||
|
- "{{ ansible_user_id }}"
|
||||||
|
|
||||||
|
- name: Define passwords
|
||||||
|
ignore_errors: yes
|
||||||
|
vars:
|
||||||
|
ansible_become_user: "root"
|
||||||
|
ansible_become_password: "{{ passwords[inventory_hostname] }}"
|
||||||
|
become: yes
|
||||||
|
when: root_password_test.rc is not defined or root_password_test.rc != 0
|
||||||
|
command:
|
||||||
|
cmd: /bin/bash -l -c "echo '{{item}}:{{ passwords[inventory_hostname] }}' | chpasswd {{ item }}"
|
||||||
|
loop:
|
||||||
|
- root
|
||||||
|
- "{{ ansible_user_id }}"
|
||||||
|
|
||||||
- name: Base packages
|
- name: Base packages
|
||||||
vars:
|
vars:
|
||||||
ansible_become_method: su
|
ansible_become_method: su
|
||||||
@ -54,31 +81,6 @@
|
|||||||
regexp: "includedir /etc/sudoers.d"
|
regexp: "includedir /etc/sudoers.d"
|
||||||
line: "#includedir /etc/sudoers.d"
|
line: "#includedir /etc/sudoers.d"
|
||||||
|
|
||||||
- name: Test root password
|
|
||||||
ignore_errors: yes
|
|
||||||
register: root_password_test
|
|
||||||
vars:
|
|
||||||
ansible_become_user: "{{ item }}"
|
|
||||||
ansible_become_method: su
|
|
||||||
ansible_become_password: "{{ passwords[inventory_hostname] }}"
|
|
||||||
become: yes
|
|
||||||
command: id
|
|
||||||
loop:
|
|
||||||
- root
|
|
||||||
- "{{ ansible_user_id }}"
|
|
||||||
|
|
||||||
- name: Define passwords
|
|
||||||
vars:
|
|
||||||
ansible_become_user: "root"
|
|
||||||
ansible_become_password: "{{ passwords[inventory_hostname] }}"
|
|
||||||
become: yes
|
|
||||||
when: root_password_test.rc is not defined or root_password_test.rc != 0
|
|
||||||
command:
|
|
||||||
cmd: /bin/bash -l -c "echo '{{item}}:{{ passwords[inventory_hostname] }}' | chpasswd {{ item }}"
|
|
||||||
loop:
|
|
||||||
- root
|
|
||||||
- "{{ ansible_user_id }}"
|
|
||||||
|
|
||||||
- name: Set up pacman.conf
|
- name: Set up pacman.conf
|
||||||
vars:
|
vars:
|
||||||
ansible_become_password: "{{ passwords[inventory_hostname] }}"
|
ansible_become_password: "{{ passwords[inventory_hostname] }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user