Fixed some lint errors

- Added missing default parameters
- Added names to tasks
- Configured changed|failed_when options
- Used command instead of shell module
- Changed local_action to delegate_to
- Added line to file ending
dehydrated
Felix Stupp 5 years ago
parent 02e63f5d2a
commit 7ac7806dc7
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -41,6 +41,7 @@
become_user: "{{ username }}"
git:
repo: https://github.com/robbyrussell/oh-my-zsh.git
version: master
dest: ~/.oh-my-zsh
- name: Configure oh-my-zsh

@ -1,6 +1,7 @@
---
- user:
- name: Remove temporary privileged user
user:
name: "{{ bootstrap_user }}"
state: absent
become: yes

@ -1,8 +1,9 @@
---
- set_fact:
- name: Set variables for shifting back
set_fact:
bootstrap_used: no
ansible_user: '{{ bootstrap_expected_user }}'
ansible_become_pass: '{{ bootstrap_expected_become_pass }}'
- meta: reset_connection
- meta: reset_connection

@ -1,11 +1,13 @@
---
- action: ping
- name: Try to ping host with expected credentials
action: ping
ignore_unreachable: true
ignore_errors: yes
register: pingtest
- meta: clear_host_errors
- set_fact:
- name: Shift if ping fails
set_fact:
bootstrap_used: yes
ansible_user: '{{ bootstrap_user }}'
ansible_become_pass: '{{ bootstrap_become_pass }}'

@ -25,10 +25,10 @@
register: root_user
- name: Store ssh public key local
local_action:
module: copy
copy:
content: "{{ root_user.ssh_public_key }}\n"
dest: "public_keys/ssh/root@{{ ansible_fqdn }}"
delegate_to: localhost
vars:
ansible_become: no

@ -31,7 +31,7 @@
- vim
- wget
- zsh
state: latest
state: present
allow_unauthenticated: no
update_cache: yes
cache_valid_time: 3600

@ -45,29 +45,29 @@
check_mode: no
- name: Create directory for host keys locally
local_action:
module: file
file:
path: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}"
state: directory
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: "u=rwx,g=rx,o=rx"
delegate_to: localhost
- name: Store ssh host keys locally
local_action:
module: copy
copy:
content: "{{ item.stdout }}\n"
dest: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}/{{ item.item }}"
owner: "{{ global_local_user }}"
group: "{{ global_local_user }}"
mode: "u=rw,g=r,o=r"
delegate_to: localhost
loop: "{{ ssh_host_keys.results }}"
loop_control:
label: "{{ item.item }}"
- name: Generate ssh host key dns fingerprints locally
local_action:
module: make
make:
chdir: "{{ global_ssh_host_key_directory }}/{{ ansible_fqdn }}"
file: "{{ playbook_dir }}/helpers/ssh_dns_fingerprints.makefile"
target: dns
delegate_to: localhost

@ -1,5 +1,7 @@
---
# TODO Change to makefile call
- name: Generate key signing key for zone {{ domain }}
command: >-
dnssec-keygen

@ -35,6 +35,7 @@
notify: reload bind9
register: database_stored
# TODO Change to makefile
# TODO test -N=UNIXTIME instead of unix time by ansible
- name: Sign zone {{ domain }}
shell: >-

@ -27,6 +27,9 @@
{{ nextcloud_keyring | quote }}
args:
chdir: "{{ nextcloud_user_directory }}"
register: receive_public_key
changed_when: receive_public_key.rc != 2
failed_when: receive_public_key.rc != 0 and receive_public_key != 2
- name: Validate signature
become_user: "{{ system_user }}"

@ -94,7 +94,9 @@
chdir: "{{ nextcloud_installation_directory }}"
register: nextcloud_apps_install_results
changed_when: "'already installed' not in nextcloud_apps_install_results.stdout"
failed_when: nextcloud_apps_install_results.rc != 0 and not (nextcloud_apps_install_results.rc == 1 and 'already installed' in nextcloud_apps_install_results.stdout)
failed_when: >-
nextcloud_apps_install_results.rc != 0 and
not (nextcloud_apps_install_results.rc == 1 and 'already installed' in nextcloud_apps_install_results.stdout)
loop: "{{ enabled_apps_list }}"
- name: Add background cron job

@ -1,11 +1,10 @@
---
- name: Run install command
shell: "{{ install_command }}"
command: "{{ install_command }}"
args:
chdir: "{{ src }}"
creates: "{{ src }}/node_modules"
executable: /bin/sh
- name: Register service for node server
template:

@ -60,8 +60,8 @@
nvak_dns_slaves: []
pre_tasks:
- name: Load ssh host key dns fingerprint for host
local_action:
module: command cat "{{ global_ssh_host_key_directory | quote }}/{{ item | quote }}/dns"
command: cat "{{ global_ssh_host_key_directory | quote }}/{{ item | quote }}/dns"
delegate_to: localhost
register: ssh_key_dns_fpr_raw
changed_when: False
loop: "{{ groups['all'] }}"

Loading…
Cancel
Save