style: fix syntax for yamlint and ansible-lint

This commit is contained in:
Adrien Waksberg 2019-02-18 22:36:09 +01:00
parent a396e6714e
commit 7eb050a76c
11 changed files with 48 additions and 10 deletions

View file

@ -1,3 +1,4 @@
---
driver:
name: docker_cli
@ -17,7 +18,7 @@ provisioner:
platforms:
- name: debian-9
driver_config:
image: nishiki/debian9:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.6' %>
image: "nishiki/debian9:ansible-<%= ENV['ANSIBLE_VERSION'] ? ENV['ANSIBLE_VERSION'] : '2.6' %>"
command: /bin/systemd
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

View file

@ -1,4 +1,4 @@
---
AllCops:
Exclude:
- db/**/*

View file

@ -1,3 +1,4 @@
---
sudo: required
language: ruby

13
.yamllint Normal file
View file

@ -0,0 +1,13 @@
---
extends: default
ignore: |
.kitchen*
vendor/
test/
rules:
line-length:
max: 120
level: warning
truthy: false

View file

@ -1,3 +1,4 @@
---
- name: restart bind
service:
name: bind9

View file

@ -1,5 +1,7 @@
---
galaxy_info:
author: Adrien Waksberg
company: Adrien Waksberg
description: Install and configure bind9 with dnssec
license: Apache2
min_ansible_version: 2.6

View file

@ -1,3 +1,4 @@
---
- name: install packages for bind9
apt:
name: '{{ packages }}'
@ -7,6 +8,10 @@
- bind9
- bind9-host
- cron
register: result
retries: 3
delay: 1
until: result is success
- name: create zone directory
file:

View file

@ -1,6 +1,9 @@
---
- name: copy private key
copy:
dest: '/etc/bind/keys/K{{ item.0 }}.+{{ "00{}".format(bind_dnssec[item.0][item.1].algorithm)[-3:] }}+{{ bind_dnssec[item.0][item.1].tag }}.private'
dest: "/etc/bind/keys/K{{ item.0 }}.\
+{{ '00{}'.format(bind_dnssec[item.0][item.1].algorithm)[-3:] }}\
+{{ bind_dnssec[item.0][item.1].tag }}.private"
content: '{{ bind_dnssec[item.0][item.1].private_key }}'
owner: root
group: bind
@ -15,7 +18,9 @@
- name: copy public key
template:
src: public.key.j2
dest: '/etc/bind/keys/K{{ item.0 }}.+{{ "00{}".format(bind_dnssec[item.0][item.1].algorithm)[-3:] }}+{{ bind_dnssec[item.0][item.1].tag }}.key'
dest: "/etc/bind/keys/K{{ item.0 }}.\
+{{ '00{}'.format(bind_dnssec[item.0][item.1].algorithm)[-3:] }}\
+{{ bind_dnssec[item.0][item.1].tag }}.key"
owner: root
group: bind
mode: 0640

View file

@ -1,3 +1,4 @@
---
- import_tasks: base.yml
tags: bind

View file

@ -1,7 +1,11 @@
- set_fact:
---
- name: set fact bind_zone_play if it empty
set_fact:
bind_zones_play: '{{ bind_zones_play|default([]) + [ item ] }}'
loop: '{{ bind_zones|dict2items }}'
when: (item.value.state is not defined or item.value.state != 'absent') and (bind_zones_subset is not defined or item.key in bind_zones_subset)
when: >
(item.value.state is not defined or item.value.state != 'absent')
and (bind_zones_subset is not defined or item.key in bind_zones_subset)
- name: create zone folder
file:
@ -24,11 +28,13 @@
notify: reload bind
- name: dnssec sign
shell: 'dnssec-signzone -3 $(head -n 1000 /dev/urandom | sha1sum | cut -b 1-16) -A -N INCREMENT -o {{ item.item.key }} -t /etc/bind/zones/{{ item.item.key }}/db'
shell: >
dnssec-signzone -3 $(head -n 1000 /dev/urandom | sha1sum | cut -b 1-16) -A -N INCREMENT
-o {{ item.item.key }} -t /etc/bind/zones/{{ item.item.key }}/db
args:
chdir: /etc/bind/keys
loop: '{{ zone.results }}'
when: item.changed and item.item.key in bind_dnssec
when: item.item.key in bind_dnssec and item.changed
notify: reload bind
- name: get zones files
@ -43,4 +49,6 @@
path: '{{ item.path }}'
state: absent
loop: '{{ zone_folders.files }}'
when: item.path|basename not in bind_zones or ('state' in bind_zones[item.path|basename] and bind_zones[item.path|basename].state == 'absent')
when: >
item.path|basename not in bind_zones or
('state' in bind_zones[item.path|basename] and bind_zones[item.path|basename].state == 'absent')

View file

@ -1,3 +1,4 @@
---
- hosts: localhost
connection: local
vars: