diff --git a/evolinux-todo/.kitchen.yml b/evolinux-todo/.kitchen.yml new file mode 100644 index 00000000..b21cc3db --- /dev/null +++ b/evolinux-todo/.kitchen.yml @@ -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 diff --git a/evolinux-todo/README.md b/evolinux-todo/README.md new file mode 100644 index 00000000..52c397c7 --- /dev/null +++ b/evolinux-todo/README.md @@ -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 +``` diff --git a/evolinux-todo/files/todo.defaults.txt b/evolinux-todo/files/todo.defaults.txt new file mode 100644 index 00000000..e69de29b diff --git a/evolinux-todo/meta/main.yml b/evolinux-todo/meta/main.yml new file mode 100644 index 00000000..041e58cc --- /dev/null +++ b/evolinux-todo/meta/main.yml @@ -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. diff --git a/evolinux-todo/tasks/cat.yml b/evolinux-todo/tasks/cat.yml new file mode 100644 index 00000000..c303009d --- /dev/null +++ b/evolinux-todo/tasks/cat.yml @@ -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 == "" diff --git a/evolinux-todo/tasks/main.yml b/evolinux-todo/tasks/main.yml new file mode 100644 index 00000000..bd098c72 --- /dev/null +++ b/evolinux-todo/tasks/main.yml @@ -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 diff --git a/evolinux-todo/tests/test.yml b/evolinux-todo/tests/test.yml new file mode 100644 index 00000000..2c9b5d72 --- /dev/null +++ b/evolinux-todo/tests/test.yml @@ -0,0 +1,4 @@ +--- +- hosts: test-kitchen + roles: + - role: evolinux-todo