library/roles/redis: Basic playbook that does not touch any configuration parameters.

library/roles/ssh-keys/tasks/root-ssh-keys.yml: Fix a mistake introduced while cleanup things for the Ansible 2 compatibility.
This commit is contained in:
Andrea Dell'Amico 2016-03-08 18:24:04 +01:00
parent 8a1edd5801
commit 7e8f11498d
4 changed files with 28 additions and 4 deletions

7
redis/defaults/main.yml Normal file
View File

@ -0,0 +1,7 @@
---
redis_enabled: True
# https://launchpad.net/~chris-lea/+archive/ubuntu/redis-server
redis_ppa_repo: ppa:chris-lea/redis-server
redis_server_pkg:
- redis-server

0
redis/handlers/main.yml Normal file
View File

19
redis/tasks/main.yml Normal file
View File

@ -0,0 +1,19 @@
---
- name: Install the Redis PPA
apt_repository: repo='{{ redis_ppa_repo }}' update_cache=yes
tags: redis
- name: Install the Redis package
apt: pkg={{ item }} state=present
with_items: '{{ redis_server_pkg }}'
tags: redis
- name: Start and enable the Redis service
service: name=redis-server state=started enabled=yes
when: redis_enabled
tags: redis
- name: Stop and disable the Redis service
service: name=redis-server state=stopped enabled=no
when: not redis_enabled
tags: redis

View File

@ -1,13 +1,11 @@
---
- name: Install the ssh keys for the authorized users
authorized_key: user=root key="{{ item }}" state=present
with_items: '{{ root_ssh_keys | default([]) }}'
when: manage_root_ssh_keys
with_items: '{{ user_ssh_key | default([]) }}'
tags: [ 'pubkeys', 'ssh_keys' ]
- name: Remove obsolete ssh keys if there are any
authorized_key: user=root key="{{ item }}" state=absent
with_items: '{{ obsolete_root_ssh_keys | default([]) }}'
when: obsolete_ssh_key is defined
with_items: '{{ obsolete_ssh_key | default([]) }}'
tags: [ 'pubkeys', 'ssh_keys' ]