Added shellcheck for script validations

dehydrated
Felix Stupp 4 years ago
parent 34614b7d6a
commit e93c11f0d7
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -47,6 +47,8 @@ global_dns_ttl: "{{ 24 * 60 * 60 }}" # default if omitted in all cases
global_ssh_key_directory: "{{ global_public_key_directory }}/ssh" global_ssh_key_directory: "{{ global_public_key_directory }}/ssh"
global_ssh_host_key_directory: "{{ global_ssh_key_directory }}/hosts" global_ssh_host_key_directory: "{{ global_ssh_key_directory }}/hosts"
global_validate_shell_script: "/usr/bin/shellcheck -format=quiet %s"
global_wireguard_private_directory: "{{ global_credentials_directory }}/wireguard" global_wireguard_private_directory: "{{ global_credentials_directory }}/wireguard"
global_wireguard_public_directory: "{{ global_public_key_directory }}/wireguard/keys" global_wireguard_public_directory: "{{ global_public_key_directory }}/wireguard/keys"
global_wireguard_peers_directory: "{{ global_public_key_directory }}/wireguard/peers" global_wireguard_peers_directory: "{{ global_public_key_directory }}/wireguard/peers"

@ -15,6 +15,7 @@
owner: root owner: root
group: root group: root
mode: "u=rwx,g=rx,o=rx" mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_shell_script }}"
loop: loop:
- backup_rename.sh - backup_rename.sh
- gpg_import_url_key.sh - gpg_import_url_key.sh
@ -26,6 +27,7 @@
owner: root owner: root
group: root group: root
mode: "u=rwx,g=rx,o=rx" mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_shell_script }}"
loop: loop:
- backup_autoremove.sh - backup_autoremove.sh
- backup_files.sh - backup_files.sh

@ -24,6 +24,7 @@
- pv # Required for scripting - pv # Required for scripting
- python3 - python3
- python3-pip - python3-pip
- shellcheck
- software-properties-common - software-properties-common
- ufw - ufw
- wget - wget

@ -7,6 +7,7 @@
owner: root owner: root
group: root group: root
mode: "u=rwx,g=rx,o=r" mode: "u=rwx,g=rx,o=r"
validate: "{{ global_validate_shell_script }}"
- name: Create repository directory for {{ repo_name }} - name: Create repository directory for {{ repo_name }}
file: file:

@ -15,6 +15,7 @@
owner: root owner: root
group: root group: root
mode: "u=rwx,g=rx,o=r" mode: "u=rwx,g=rx,o=r"
validate: "{{ global_validate_shell_script }}"
- name: Configure auto backup files of {{ backup_name }} - name: Configure auto backup files of {{ backup_name }}
cron: cron:

@ -17,6 +17,7 @@
owner: "{{ system_user }}" owner: "{{ system_user }}"
group: "{{ system_user }}" group: "{{ system_user }}"
mode: "u=rwx,g=rx,o=" mode: "u=rwx,g=rx,o="
validate: "{{ global_validate_shell_script }}"
- name: Configure crontab for discover script - name: Configure crontab for discover script
cron: cron:

@ -22,6 +22,7 @@
owner: root owner: root
group: root group: root
mode: u=rwx,g=rx,o= mode: u=rwx,g=rx,o=
validate: "{{ global_validate_shell_script }}"
- name: Configure pam for ssh notify - name: Configure pam for ssh notify
lineinfile: lineinfile:

@ -15,6 +15,7 @@
owner: root owner: root
group: root group: root
mode: "u=rwx,g=rx,o=r" mode: "u=rwx,g=rx,o=r"
validate: "{{ global_validate_shell_script }}"
- name: Configure auto backup mysql database of {{ database_name }} - name: Configure auto backup mysql database of {{ database_name }}
cron: cron:

@ -80,6 +80,7 @@
owner: root owner: root
group: "{{ system_user }}" group: "{{ system_user }}"
mode: "u=rwx,g=rx,o=" mode: "u=rwx,g=rx,o="
validate: "{{ global_validate_shell_script }}"
- name: Register service for linx - name: Register service for linx
template: template:

@ -76,6 +76,7 @@
owner: "{{ system_user }}" owner: "{{ system_user }}"
group: "{{ system_user }}" group: "{{ system_user }}"
mode: "u=rx,g=r,o=" mode: "u=rx,g=r,o="
validate: "{{ global_validate_shell_script }}"
notify: notify:
- restart minecraft server - restart minecraft server
loop: loop:
@ -91,6 +92,7 @@
owner: "{{ system_user }}" owner: "{{ system_user }}"
group: "{{ system_user }}" group: "{{ system_user }}"
mode: "u=rx,g=r,o=" mode: "u=rx,g=r,o="
validate: "{{ global_validate_shell_script }}"
loop: loop:
- name: "control.sh" - name: "control.sh"
path: "{{ remote_control_script }}" path: "{{ remote_control_script }}"

@ -82,6 +82,7 @@
owner: root owner: root
group: root group: root
mode: "u=rwx,g=r,o=r" mode: "u=rwx,g=r,o=r"
validate: "{{ global_validate_shell_script }}"
notify: notify:
- reload wireguard interface - reload wireguard interface
loop: loop:

Loading…
Cancel
Save