Fixed linting, ignore vault file for linting

This commit is contained in:
Bastian de Byl
2020-09-25 12:17:06 -04:00
parent d6c973fa0f
commit 4ef5cc815f
4 changed files with 16 additions and 2 deletions

View File

@@ -35,6 +35,12 @@ ${VAULT_PASS_FILE}: ${ANSIBLE}
${VAULT_FILE}: ${VAULT_PASS_FILE}
${ANSIBLE_VAULT} create --vault-password-file ${VAULT_PASS_FILE} $@
YAML_FILES=$(shell find ansible/ -name '*.yml' -not -name '*vault*')
# Ansible Lint skip list:
# [701] - "No 'galaxy_info' found (in role)"
ANSIBLE_LINT_SKIP_LIST=701
# Targets
deploy: ${ANSIBLE} ${VAULT_FILE}
${ANSIBLE} --diff --private-key ${SSH_KEY} -t ${TAGS} -i ${ANSIBLE_INVENTORY} --vault-password-file ${VAULT_PASS_FILE} ansible/deploy.yml
@@ -46,5 +52,7 @@ vault: ${ANSIBLE_VAULT} ${VAULT_FILE}
${ANSIBLE_VAULT} edit --vault-password-file ${VAULT_PASS_FILE} ${VAULT_FILE}
lint: ${LINT_YAML} ${LINT_ANSIBLE}
${LINT_YAML} ansible/
${LINT_ANSIBLE} ansible/
@printf "Running yamllint...\n"
-@${LINT_YAML} ${YAML_FILES}
@printf "Running ansible-lint with SKIP_LIST: [%s]...\n" "${ANSIBLE_LINT_SKIP_LIST}"
-@${LINT_ANSIBLE} -x ${ANSIBLE_LINT_SKIP_LIST} ${YAML_FILES}

View File

@@ -17,6 +17,7 @@
copy:
src: files/fail2ban/jails/{{ item }}
dest: /etc/fail2ban/jail.d/{{ item }}
mode: 0644
with_items: "{{ fail2ban_jails }}"
notify: restart_fail2ban
tags: security

View File

@@ -4,6 +4,7 @@
copy:
src: files/nginx/nginx.conf
dest: /etc/nginx/nginx.conf
mode: 0644
notify: restart_nginx
tags: http
@@ -12,6 +13,7 @@
file:
path: "/etc/nginx/{{ item }}"
state: directory
mode: 0644
with_items:
- sites-enabled
- sites-available
@@ -31,6 +33,7 @@
file:
path: "/var/log/nginx/error.log"
state: file
mode: 0644
notify: restart_fail2ban
tags: http, security
@@ -39,6 +42,7 @@
template:
src: "templates/nginx/sites/{{ item }}.j2"
dest: "/etc/nginx/sites-available/{{ item }}"
mode: 0644
with_items:
- "{{ ci_server_name }}.http.conf"
notify: restart_nginx

View File

@@ -42,6 +42,7 @@
template:
src: "templates/nginx/sites/{{ item }}.j2"
dest: "/etc/nginx/sites-available/{{ item }}"
mode: 0644
with_items:
- "{{ ci_server_name }}.https.conf"
tags: ssl