Force quoted strings
Signed-off-by: Norman Ziegner <norman.ziegner@ufz.de>
This commit is contained in:
parent
c6260b4c42
commit
c6ecb79546
|
@ -1,17 +1,17 @@
|
|||
name: Ansible Lint check
|
||||
name: "Ansible Lint check"
|
||||
# visit https://github.com/marketplace/actions/ansible-lint for infos
|
||||
|
||||
on: [push, pull_request]
|
||||
on: ["push", "pull_request"]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: "ubuntu-latest"
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: "actions/checkout@v2"
|
||||
|
||||
- name: Lint Ansible Playbook
|
||||
uses: ansible/ansible-lint-action@v6.0.2
|
||||
- name: "Lint Ansible Playbook"
|
||||
uses: "ansible/ansible-lint-action@v6.0.2"
|
||||
with:
|
||||
targets: "."
|
||||
|
|
18
.travis.yml
18
.travis.yml
|
@ -1,16 +1,16 @@
|
|||
sudo: required
|
||||
language: python
|
||||
services: docker
|
||||
sudo: "required"
|
||||
language: "python"
|
||||
services: "docker"
|
||||
|
||||
cache: pip
|
||||
cache: "pip"
|
||||
|
||||
install:
|
||||
- pip install ansible docker
|
||||
- ansible-galaxy install -r tests/requirements.yml -p tests/roles/
|
||||
- "pip install ansible docker"
|
||||
- "ansible-galaxy install -r tests/requirements.yml -p tests/roles/"
|
||||
|
||||
script:
|
||||
- ansible --version
|
||||
- tests/test.sh
|
||||
- "ansible --version"
|
||||
- "tests/test.sh"
|
||||
|
||||
notifications:
|
||||
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
||||
webhooks: "https://galaxy.ansible.com/api/v1/notifications/"
|
||||
|
|
|
@ -32,5 +32,10 @@ rules:
|
|||
new-line-at-end-of-file: "disable"
|
||||
new-lines:
|
||||
type: "unix"
|
||||
quoted-strings:
|
||||
quote-type: "any"
|
||||
required: True
|
||||
extra-required: [ ]
|
||||
extra-allowed: [ ]
|
||||
trailing-spaces: "disable"
|
||||
truthy: "disable"
|
||||
|
|
|
@ -1,40 +1,26 @@
|
|||
---
|
||||
galaxy_info:
|
||||
role_name: unattended_upgrades
|
||||
author: hifis
|
||||
description: Setup unattended-upgrades on Debian-based systems
|
||||
license: GPLv2
|
||||
min_ansible_version: 1.4
|
||||
role_name: "unattended_upgrades"
|
||||
author: "hifis"
|
||||
description: "Setup unattended-upgrades on Debian-based systems"
|
||||
license: "GPLv2"
|
||||
min_ansible_version: "1.4"
|
||||
platforms:
|
||||
- name: Ubuntu
|
||||
- name: "Ubuntu"
|
||||
versions:
|
||||
- precise
|
||||
- raring
|
||||
- saucy
|
||||
- trusty
|
||||
- utopic
|
||||
- name: Debian
|
||||
- "precise"
|
||||
- "raring"
|
||||
- "saucy"
|
||||
- "trusty"
|
||||
- "utopic"
|
||||
- name: "Debian"
|
||||
versions:
|
||||
- wheezy
|
||||
- jessie
|
||||
- buster
|
||||
- bullseye
|
||||
#
|
||||
# Below are all categories currently available. Just as with
|
||||
# the platforms above, uncomment those that apply to your role.
|
||||
#
|
||||
- "wheezy"
|
||||
- "jessie"
|
||||
- "buster"
|
||||
- "bullseye"
|
||||
|
||||
galaxy_tags:
|
||||
#- cloud
|
||||
#- cloud:ec2
|
||||
#- cloud:gce
|
||||
#- cloud:rax
|
||||
#- database
|
||||
#- database:nosql
|
||||
#- database:sql
|
||||
#- development
|
||||
#- monitoring
|
||||
#- networking
|
||||
#- packaging
|
||||
- system
|
||||
#- web
|
||||
- "system"
|
||||
|
||||
dependencies: []
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
- ansible.builtin.include: unattended-upgrades.yml
|
||||
tags: unattended
|
||||
- ansible.builtin.include: "unattended-upgrades.yml"
|
||||
tags: "unattended"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
# Ignored, since newer distros don't need this package
|
||||
# https://github.com/jnv/ansible-role-unattended-upgrades/issues/6
|
||||
- name: install update-notifier-common
|
||||
- name: "install update-notifier-common"
|
||||
ansible.builtin.apt:
|
||||
pkg: update-notifier-common
|
||||
state: present
|
||||
pkg: "update-notifier-common"
|
||||
state: "present"
|
||||
failed_when: false
|
||||
|
|
|
@ -1,46 +1,50 @@
|
|||
---
|
||||
- name: add distribution-specific variables
|
||||
- name: "add distribution-specific variables"
|
||||
ansible.builtin.include_vars: "{{ ansible_distribution }}.yml"
|
||||
|
||||
- name: add Debian Wheezy workaround
|
||||
- name: "add Debian Wheezy workaround"
|
||||
ansible.builtin.include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
|
||||
when: (ansible_distribution == "Debian") and (ansible_distribution_release == "wheezy")
|
||||
when:
|
||||
- "ansible_distribution == 'Debian'"
|
||||
- "ansible_distribution_release == 'wheezy'"
|
||||
|
||||
- name: add Debian Bullseye workaround
|
||||
- name: "add Debian Bullseye workaround"
|
||||
ansible.builtin.include_vars: "{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml"
|
||||
when: (ansible_distribution == "Debian") and (ansible_distribution_release == "bullseye")
|
||||
when:
|
||||
- "ansible_distribution == 'Debian'"
|
||||
- "ansible_distribution_release == 'bullseye'"
|
||||
|
||||
- name: install powermgmt-base
|
||||
- name: "install powermgmt-base"
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
state: present
|
||||
state: "present"
|
||||
cache_valid_time: "{{ unattended_cache_valid_time }}"
|
||||
update_cache: yes
|
||||
when: unattended_only_on_ac_power
|
||||
update_cache: "yes"
|
||||
when: "unattended_only_on_ac_power"
|
||||
|
||||
- name: install unattended-upgrades
|
||||
- name: "install unattended-upgrades"
|
||||
ansible.builtin.apt:
|
||||
pkg: unattended-upgrades
|
||||
state: present
|
||||
pkg: "unattended-upgrades"
|
||||
state: "present"
|
||||
cache_valid_time: "{{ unattended_cache_valid_time }}"
|
||||
update_cache: yes
|
||||
update_cache: "yes"
|
||||
|
||||
- name: install reboot dependencies
|
||||
ansible.builtin.include: reboot.yml
|
||||
when: unattended_automatic_reboot|bool
|
||||
- name: "install reboot dependencies"
|
||||
ansible.builtin.include: "reboot.yml"
|
||||
when: "unattended_automatic_reboot | bool"
|
||||
|
||||
- name: create APT auto-upgrades configuration
|
||||
- name: "create APT auto-upgrades configuration"
|
||||
ansible.builtin.template:
|
||||
src: auto-upgrades.j2
|
||||
dest: /etc/apt/apt.conf.d/20auto-upgrades
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
src: "auto-upgrades.j2"
|
||||
dest: "/etc/apt/apt.conf.d/20auto-upgrades"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
|
||||
- name: create unattended-upgrades configuration
|
||||
- name: "create unattended-upgrades configuration"
|
||||
ansible.builtin.template:
|
||||
src: unattended-upgrades.j2
|
||||
dest: /etc/apt/apt.conf.d/50unattended-upgrades
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
src: "unattended-upgrades.j2"
|
||||
dest: "/etc/apt/apt.conf.d/50unattended-upgrades"
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
---
|
||||
- src: chrismeyersfsu.provision_docker
|
||||
name: provision_docker
|
||||
- src: "chrismeyersfsu.provision_docker"
|
||||
name: "provision_docker"
|
||||
|
|
|
@ -1,39 +1,39 @@
|
|||
---
|
||||
- name: Bring up Docker containers
|
||||
hosts: localhost
|
||||
- name: "Bring up Docker containers"
|
||||
hosts: "localhost"
|
||||
gather_facts: false
|
||||
vars:
|
||||
inventory:
|
||||
- name: ubuntu_latest
|
||||
- name: "ubuntu_latest"
|
||||
image: "ubuntu:latest"
|
||||
- name: ubuntu_bionic
|
||||
- name: "ubuntu_bionic"
|
||||
image: "ubuntu:bionic"
|
||||
- name: ubuntu_xenial
|
||||
- name: "ubuntu_xenial"
|
||||
image: "ubuntu:xenial"
|
||||
- name: ubuntu_trusty
|
||||
- name: "ubuntu_trusty"
|
||||
image: "ubuntu:trusty"
|
||||
# 6/2020: Disabled Debian Testing due to missing python packages (python-apt)
|
||||
#- name: debian_testing
|
||||
# image: "debian:testing"
|
||||
- name: debian_stable
|
||||
- name: "debian_stable"
|
||||
image: "debian:stable"
|
||||
- name: debian_oldstable
|
||||
- name: "debian_oldstable"
|
||||
image: "debian:oldstable"
|
||||
roles:
|
||||
- role: provision_docker
|
||||
- role: "provision_docker"
|
||||
provision_docker_inventory: "{{ inventory }}"
|
||||
provision_docker_privileged: true
|
||||
provision_docker_use_docker_connection: true
|
||||
|
||||
- name: Test role
|
||||
hosts: docker_containers
|
||||
- name: "Test role"
|
||||
hosts: "docker_containers"
|
||||
gather_facts: false
|
||||
pre_tasks:
|
||||
- name: Provision Python
|
||||
raw: bash -c "test -e /usr/bin/python || (apt-get -y update && apt-get install -y python)"
|
||||
register: output
|
||||
changed_when: output.stdout
|
||||
- name: Gather facts
|
||||
- name: "Provision Python"
|
||||
raw: 'bash -c "test -e /usr/bin/python || (apt-get -y update && apt-get install -y python)"'
|
||||
register: "output"
|
||||
changed_when: "output.stdout"
|
||||
- name: "Gather facts"
|
||||
setup:
|
||||
vars:
|
||||
unattended_autofix_interrupted_dpkg: false
|
||||
|
@ -43,24 +43,24 @@
|
|||
unattended_update_days: '{"Sat"}'
|
||||
roles:
|
||||
# Searched for in ../.. (see ansible.cfg)
|
||||
- ansible-role-unattended-upgrades
|
||||
- "ansible-role-unattended-upgrades"
|
||||
tasks:
|
||||
- name: Idempotency check
|
||||
- name: "Idempotency check"
|
||||
include_role:
|
||||
name: ansible-role-unattended-upgrades
|
||||
register: idempotency
|
||||
- name: fail when idempotency.changed
|
||||
name: "ansible-role-unattended-upgrades"
|
||||
register: "idempotency"
|
||||
- name: "fail when idempotency.changed"
|
||||
fail:
|
||||
msg: Role failed idempotency check
|
||||
when: idempotency.changed
|
||||
msg: "Role failed idempotency check"
|
||||
when: "idempotency.changed"
|
||||
|
||||
- name: Get apt-config variables
|
||||
command: apt-config dump
|
||||
register: aptconfig
|
||||
- name: "Get apt-config variables"
|
||||
command: "apt-config dump"
|
||||
register: "aptconfig"
|
||||
changed_when: false
|
||||
- name: Check for registered variables
|
||||
- name: "Check for registered variables"
|
||||
assert:
|
||||
that: item in aptconfig.stdout
|
||||
that: "item in aptconfig.stdout"
|
||||
with_items:
|
||||
- 'APT::Periodic::Unattended-Upgrade "1"'
|
||||
- 'Unattended-Upgrade::AutoFixInterruptedDpkg "false"'
|
||||
|
@ -72,6 +72,6 @@
|
|||
- 'Unattended-Upgrade::Update-Days "";'
|
||||
- 'Unattended-Upgrade::Update-Days:: "Sat";'
|
||||
|
||||
- name: Dry run unattended-upgrades
|
||||
command: /usr/bin/unattended-upgrades --dry-run
|
||||
changed_when: idempotency.changed|bool
|
||||
- name: "Dry run unattended-upgrades"
|
||||
command: "/usr/bin/unattended-upgrades --dry-run"
|
||||
changed_when: "idempotency.changed | bool"
|
||||
|
|
Loading…
Reference in New Issue