[TIDY] Set some "diff: false", fix linter warnings
This commit is contained in:
parent
120072e0d5
commit
cdd9bc58d2
|
@ -7,7 +7,7 @@
|
||||||
tinc_base_dir: /usr/local/etc/tinc
|
tinc_base_dir: /usr/local/etc/tinc
|
||||||
|
|
||||||
- name: Distribute - Copy hostfiles to targets
|
- name: Distribute - Copy hostfiles to targets
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ role_path }}/files/tmp/"
|
src: "{{ role_path }}/files/tmp/"
|
||||||
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/"
|
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Tinc VPN Setup and Configuration
|
# Tinc VPN Setup and Configuration
|
||||||
|
|
||||||
- name: Main - Set different base dir for macOS
|
- name: Main - Set different base dir for macOS
|
||||||
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
|
when: (override_os_family is defined) | ternary(override_os_family, ansible_os_family) == "Darwin"
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
tinc_base_dir: /usr/local/etc/tinc
|
tinc_base_dir: /usr/local/etc/tinc
|
||||||
|
|
||||||
|
@ -10,17 +10,17 @@
|
||||||
ansible.builtin.include_tasks: "{{ item }}"
|
ansible.builtin.include_tasks: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- "setup-{{ ansible_distribution }}.yml"
|
- "setup-{{ ansible_distribution }}.yml"
|
||||||
- "setup-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml"
|
- "setup-{{ (override_os_family is defined) | ternary(override_os_family, ansible_os_family) }}.yml"
|
||||||
|
|
||||||
- name: Main - Create tinc directories
|
- name: Main - Create tinc directories
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts"
|
path: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts"
|
||||||
state: directory
|
state: directory
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Main - Create new host keypair
|
- name: Main - Create new host keypair
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
|
export PATH=/usr/local/sbin:/usr/local/bin:$PATH
|
||||||
tincd -n {{ tinc_vpn_id }} -K4096
|
tincd -n {{ tinc_vpn_id }} -K4096
|
||||||
|
@ -29,61 +29,61 @@
|
||||||
creates: rsa_key.priv
|
creates: rsa_key.priv
|
||||||
|
|
||||||
- name: Main - Create config
|
- name: Main - Create config
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "{{ role_path }}/templates/tinc.conf.j2"
|
src: "{{ role_path }}/templates/tinc.conf.j2"
|
||||||
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/tinc.conf"
|
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/tinc.conf"
|
||||||
|
|
||||||
- name: Main - Fetch public key
|
- name: Main - Fetch public key
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.fetch:
|
ansible.builtin.fetch:
|
||||||
src: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/rsa_key.pub"
|
src: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/rsa_key.pub"
|
||||||
dest: "{{ role_path }}/templates/tmp/rsa_key-{{ ansible_hostname | replace('-', '_') }}.pub"
|
dest: "{{ role_path }}/templates/tmp/rsa_key-{{ ansible_hostname | replace('-', '_') }}.pub"
|
||||||
flat: yes
|
flat: true
|
||||||
|
|
||||||
- name: Main - Create own hostfile
|
- name: Main - Create own hostfile
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "{{ role_path }}/templates/hostfile.j2"
|
src: "{{ role_path }}/templates/hostfile.j2"
|
||||||
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/{{ ansible_hostname | replace('-', '_') }}"
|
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/{{ ansible_hostname | replace('-', '_') }}"
|
||||||
|
|
||||||
- name: Main - Create tinc-up script
|
- name: Main - Create tinc-up script
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "{{ role_path }}/templates/tinc-up.j2"
|
src: "{{ role_path }}/templates/tinc-up.j2"
|
||||||
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/tinc-up"
|
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/tinc-up"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Main - Create tinc-down script
|
- name: Main - Create tinc-down script
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: "{{ role_path }}/templates/tinc-down.j2"
|
src: "{{ role_path }}/templates/tinc-down.j2"
|
||||||
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/tinc-down"
|
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/tinc-down"
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
- name: Main - Fetch all hostfiles
|
- name: Main - Fetch all hostfiles
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.fetch:
|
ansible.builtin.fetch:
|
||||||
src: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/{{ ansible_hostname | replace('-', '_') }}"
|
src: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/{{ ansible_hostname | replace('-', '_') }}"
|
||||||
dest: "{{ role_path }}/files/tmp/{{ ansible_hostname | replace('-', '_') }}"
|
dest: "{{ role_path }}/files/tmp/{{ ansible_hostname | replace('-', '_') }}"
|
||||||
flat: yes
|
flat: true
|
||||||
|
|
||||||
- name: "Main - Enable {{ tinc_vpn_id }}"
|
- name: "Main - Enable {{ tinc_vpn_id }}"
|
||||||
when: ansible_os_family != 'Darwin'
|
when: ansible_os_family != 'Darwin'
|
||||||
become: yes
|
become: true
|
||||||
block:
|
block:
|
||||||
- name: "Main - Enable {{ tinc_vpn_id }} in tinc config"
|
- name: "Main - Enable {{ tinc_vpn_id }} in tinc config"
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
name: "{{ tinc_base_dir }}/nets.boot"
|
name: "{{ tinc_base_dir }}/nets.boot"
|
||||||
line: "{{ tinc_vpn_id }}"
|
line: "{{ tinc_vpn_id }}"
|
||||||
create: yes
|
create: true
|
||||||
- name: "Main - Enable and restart tinc service"
|
- name: "Main - Enable and restart tinc service"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: tinc
|
name: tinc
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: true
|
||||||
- name: "Main - Enable and restart tinc@{{ tinc_vpn_id }} service"
|
- name: "Main - Enable and restart tinc@{{ tinc_vpn_id }} service"
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
name: "tinc@{{ tinc_vpn_id }}"
|
name: "tinc@{{ tinc_vpn_id }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
enabled: yes
|
enabled: true
|
||||||
|
|
|
@ -8,3 +8,4 @@
|
||||||
vars:
|
vars:
|
||||||
packages:
|
packages:
|
||||||
- tinc
|
- tinc
|
||||||
|
diff: false
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
# Tinc/Setup: Install tinc application - Debian Version
|
# Tinc/Setup: Install tinc application - Debian Version
|
||||||
|
|
||||||
- name: Setup - Install
|
- name: Setup - Install
|
||||||
become: yes
|
become: true
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ packages }}"
|
name: "{{ packages }}"
|
||||||
state: present
|
state: present
|
||||||
vars:
|
vars:
|
||||||
packages:
|
packages:
|
||||||
- tinc
|
- tinc
|
||||||
|
diff: false
|
||||||
|
|
Loading…
Reference in a new issue