Add an "evolinux-todo" role

It makes sure there is a /etc/evolinux/todo.txt where we can append 
tasks to be done manually.

It has a task to output the content of the file, for exemple at the end 
of a playbook run.
This commit is contained in:
Jérémy Lecour 2018-08-24 12:08:55 +02:00 committed by Jérémy Lecour
parent 3e3c6437e8
commit c1afb68d19
7 changed files with 107 additions and 0 deletions

View File

@ -0,0 +1,28 @@
---
driver:
name: docker
privileged: true
use_sudo: false
provisioner:
name: ansible_playbook
hosts: test-kitchen
roles_path: ../
ansible_verbose: true
require_ansible_source: false
require_chef_for_busser: false
idempotency_test: true
platforms:
- name: debian
driver_config:
image: evolix/ansible:2.2.1
suites:
- name: default
provisioner:
name: ansible_playbook
playbook: ./tests/test.yml
transport:
max_ssh_sessions: 6

15
evolinux-todo/README.md Normal file
View File

@ -0,0 +1,15 @@
# evocheck
Creates an /etc/evolinux/todo.txt file to hold information about things to do, gathered by humans or other Ansible tasks
## Tasks
The main tasks install the default file if missing.
A separate `cat.yml` file can be imported manually in playbooks or roles to get the content of the file. Example :
```
- include_role:
name: evolinux-todo
tasks_from: cat.yml
```

View File

View File

@ -0,0 +1,30 @@
galaxy_info:
author: Jeremy Lecour
description: Install evolinux-todo
company: Evolix
issue_tracker_url: https://forge.evolix.org/projects/evocheck/issues
license: GPLv2
min_ansible_version: 2.2
platforms:
- name: Debian
versions:
- jessie
- stretch
galaxy_tags: []
# List tags for your role here, one per line. A tag is
# a keyword that describes and categorizes the role.
# Users find roles by searching for tags. Be sure to
# remove the '[]' above if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of
# alphanumeric characters. Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line.
# Be sure to remove the '[]' above if you add dependencies
# to this list.

View File

@ -0,0 +1,16 @@
---
- name: cat /etc/evolinux/todo.txt
command: "cat /etc/evolinux/todo.txt"
register: evolinux_todo
changed_when: False
failed_when: False
check_mode: no
- debug:
var: evolinux_todo.stdout_lines
when: evolinux_todo.stdout != ""
- debug:
msg: "There is nothing to do !"
when: evolinux_todo.stdout == ""

View File

@ -0,0 +1,14 @@
---
- name: /etc/evolinux is present
file:
dest: /etc/evolinux
mode: "0700"
state: directory
- name: /etc/evolinux/todo.txt is present
copy:
src: todo.defaults.txt
dest: /etc/evolinux/todo.txt
mode: "0640"
force: no

View File

@ -0,0 +1,4 @@
---
- hosts: test-kitchen
roles:
- role: evolinux-todo