Skip to content

Commit b6f2dfe

Browse files
authored
Merge pull request #1 from clouddrove/ops
Ops
2 parents b7fe53b + 34689e9 commit b6f2dfe

File tree

16 files changed

+399
-54
lines changed

16 files changed

+399
-54
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ignored files
2+
.idea
3+
*.iml
4+
*.zip
5+
molecule

.pre-commit-config.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
repos:
3+
4+
- repo: https://github.com/pre-commit/pre-commit-hooks.git
5+
rev: v2.2.3
6+
hooks:
7+
- id: end-of-file-fixer
8+
- id: trailing-whitespace
9+
- id: mixed-line-ending
10+
- id: check-byte-order-marker
11+
- id: check-executables-have-shebangs
12+
- id: check-merge-conflict
13+
- id: debug-statements
14+
- id: check-yaml
15+
- id: check-added-large-files
16+
17+
- repo: https://github.com/ansible/ansible-lint.git
18+
rev: v4.1.0
19+
hooks:
20+
- id: ansible-lint
21+
files: \.(yaml|yml)$

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Cloud Drove
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export GENIE_PATH ?= $(shell 'pwd')/../../../genie
2+
3+
include $(GENIE_PATH)/Makefile

README.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
<!-- This file was automatically generated by the `geine`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->
2+
3+
4+
<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62451340-ba925480-b78b-11e9-99f0-13a8a9cc0afa.png" width="100" height="100"></p>
5+
6+
<h1 align="center">
7+
Ansible Role Docker Redis
8+
</h1>
9+
10+
<p align="center" style="font-size: 1.2rem;">
11+
This ansible role is used to setup Redis server with docker on Debian.
12+
</p>
13+
14+
<p align="center">
15+
16+
<a href="https://www.ansible.com">
17+
<img src="https://img.shields.io/badge/Ansible-2.8-green?style=flat&logo=ansible" alt="Ansible">
18+
</a>
19+
<a href="LICENSE.md">
20+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="Licence">
21+
</a>
22+
<a href="https://ubuntu.com/">
23+
<img src="https://img.shields.io/badge/ubuntu-16.x-orange?style=flat&logo=ubuntu" alt="Distribution">
24+
</a>
25+
<a href="https://ubuntu.com/">
26+
<img src="https://img.shields.io/badge/ubuntu-18.x-orange?style=flat&logo=ubuntu" alt="Distribution">
27+
</a>
28+
29+
30+
</p>
31+
<p align="center">
32+
33+
<a href='https://facebook.com/sharer/sharer.php?u=https://github.com/clouddrove/ansible-role-docker-redis'>
34+
<img title="Share on Facebook" src="https://user-images.githubusercontent.com/50652676/62817743-4f64cb80-bb59-11e9-90c7-b057252ded50.png" />
35+
</a>
36+
<a href='https://www.linkedin.com/shareArticle?mini=true&title=Ansible+Role+Docker+Redis&url=https://github.com/clouddrove/ansible-role-docker-redis'>
37+
<img title="Share on LinkedIn" src="https://user-images.githubusercontent.com/50652676/62817742-4e339e80-bb59-11e9-87b9-a1f68cae1049.png" />
38+
</a>
39+
<a href='https://twitter.com/intent/tweet/?text=Ansible+Role+Docker+Redis&url=https://github.com/clouddrove/ansible-role-docker-redis'>
40+
<img title="Share on Twitter" src="https://user-images.githubusercontent.com/50652676/62817740-4c69db00-bb59-11e9-8a79-3580fbbf6d5c.png" />
41+
</a>
42+
43+
</p>
44+
<hr>
45+
46+
47+
48+
We eat, drink, sleep and most importantly love **DevOps**. DevOps always promotes automation and standardisation. While setting up various environments like local, dev, testing, production, etc. it is critical to maintain the same environment across. This can easily be achieved using automating the environment setup & installation with the help of ansible-playbooks.
49+
50+
Smaller roles are created for each environment elements; which also include tasks & tests. These roles can then be grouped together in [ansible-playbook](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html) to achieve the desired yet consistent results.
51+
52+
53+
54+
## Prerequisites
55+
56+
This module has a few dependencies:
57+
58+
- [Ansible2.8](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
59+
- [Python](https://www.python.org/downloads)
60+
- [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu)
61+
62+
63+
64+
65+
## What Includes
66+
67+
Followiing things includes in this role:
68+
- redis-cli
69+
- redis-server
70+
71+
72+
73+
74+
75+
76+
77+
## Example Playbook
78+
79+
**IMPORTANT:** Since the `master` branch used in `source` varies based on new modifications, we suggest that you use the release versions [here](https://github.com/clouddrove/ansible-role-docker-redis/releases).
80+
81+
82+
```yaml
83+
- hosts: localhost
84+
remote_user: ubuntu
85+
become: true
86+
roles:
87+
- clouddrove.ansible_role_docker_redis
88+
```
89+
90+
91+
## Variables
92+
93+
```yaml
94+
redis_version: "5.0.3"
95+
redis_user: redis
96+
redis_group: redis
97+
mount_path: /data
98+
redis_server_opt_dir: "/opt/redis-server"
99+
redis_server_config_dir: "{{ redis_server_opt_dir }}/config"
100+
redis_server_log_dir: "/var/log/redis"
101+
redis_server_data_dir: "{{ mount_path }}/redis-server"
102+
redis_server_bind: 0.0.0.0
103+
redis_server_port: 6379
104+
redis_server_password: false
105+
redis_server_min_slaves_to_write: 0
106+
redis_server_min_slaves_max_lag: 10
107+
redis_server_tcp_backlog: 10000
108+
redis_server_tcp_keepalive: 20
109+
redis_server_maxclients: 30000
110+
redis_server_timeout: 0
111+
redis_server_slaveof: false
112+
redis_server_slave_read_only: "yes"
113+
redis_server_slave_priority: 100
114+
redis_server_repl_backlog_size: false
115+
redis_server_dir: /var/lib/redis
116+
redis_server_logfile: '"/var/log/redis/redis-server.log"'
117+
redis_server_databases: 16
118+
redis_server_loglevel: notice
119+
redis_server_slowlog_log_slower_than: 10000
120+
redis_server_slowlog_max_len: 128
121+
redis_server_maxmemory: false
122+
redis_server_maxmemory_policy: noeviction
123+
redis_server_rename_commands: []
124+
redis_server_save:
125+
- 900 1
126+
- 300 10
127+
- 60 10000
128+
redis_server_stop_writes_on_bgsave_error: "yes"
129+
redis_server_rdbcompression: "yes"
130+
redis_server_rdbchecksum: "yes"
131+
redis_server_appendonly: "no"
132+
redis_server_appendfilename: "appendonly.aof"
133+
redis_server_appendfsync: "everysec"
134+
redis_server_no_appendfsync_on_rewrite: "no"
135+
redis_server_auto_aof_rewrite_percentage: "100"
136+
redis_server_auto_aof_rewrite_min_size: "64mb"
137+
redis_server_notify_keyspace_events: '""'
138+
```
139+
140+
141+
## Installation
142+
143+
```console
144+
$ ansible-galaxy install clouddrove.ansible_role_docker_redis
145+
```
146+
147+
148+
149+
150+
151+
152+
## Feedback
153+
If you come accross a bug or have any feedback, please log it in our [issue tracker](https://github.com/clouddrove/ansible-role-docker-redis/issues), or feel free to drop us an email at [hello@clouddrove.com](mailto:hello@clouddrove.com).
154+
155+
If you have found it worth your time, go ahead and give us a ★ on [our GitHub](https://github.com/clouddrove/ansible-role-docker-redis)!
156+
157+
## About us
158+
159+
At [CloudDrove][website], we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.
160+
161+
<p align="center">We are <b> The Cloud Experts!</b></p>
162+
<hr />
163+
<p align="center">We ❤️ <a href="https://github.com/clouddrove">Open Source</a> and you can check out <a href="https://github.com/clouddrove">our other modules</a> to get help with your new Cloud ideas.</p>
164+
165+
[website]: https://clouddrove.com
166+
[github]: https://github.com/clouddrove
167+
[linkedin]: https://cpco.io/linkedin
168+
[twitter]: https://twitter.com/clouddrove/
169+
[email]: https://clouddrove.com/contact-us.html
170+
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=

README.yaml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
#
3+
# This is the canonical configuration for the `README.md`
4+
# Run `make readme` to rebuild the `README.md`
5+
#
6+
7+
# Name of this project
8+
name: Ansible Role Docker Redis
9+
10+
# License of this project
11+
license: "MIT"
12+
13+
# Canonical GitHub repo
14+
github_repo: clouddrove/ansible-role-docker-redis
15+
16+
# Badges to display
17+
badges:
18+
- name: "Ansible"
19+
image: "https://img.shields.io/badge/Ansible-2.8-green?style=flat&logo=ansible"
20+
url: "https://www.ansible.com"
21+
- name: "Licence"
22+
image: "https://img.shields.io/badge/License-MIT-blue.svg"
23+
url: "LICENSE.md"
24+
- name: "Distribution"
25+
image: "https://img.shields.io/badge/ubuntu-16.x-orange?style=flat&logo=ubuntu"
26+
url: "https://ubuntu.com/"
27+
- name: "Distribution"
28+
image: "https://img.shields.io/badge/ubuntu-18.x-orange?style=flat&logo=ubuntu"
29+
url: "https://ubuntu.com/"
30+
31+
# Prerequesties to display
32+
# yamllint disable
33+
prerequesties:
34+
- name: "Ansible2.8"
35+
url: "https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html"
36+
- name: "Python"
37+
url: "https://www.python.org/downloads"
38+
- name: "Docker"
39+
url: "https://docs.docker.com/install/linux/docker-ce/ubuntu"
40+
# yamllint enable
41+
# What Includes to display
42+
what_includes:
43+
- name: "redis-cli"
44+
- name: "redis-server"
45+
46+
47+
# description of this project
48+
description: |-
49+
This ansible role is used to setup Redis server with docker on Debian.
50+
51+
# How to use this project
52+
usage: |-
53+
```yaml
54+
- hosts: localhost
55+
remote_user: ubuntu
56+
become: true
57+
roles:
58+
- clouddrove.ansible_role_docker_redis
59+
```
60+
# Variables use in the project
61+
variables: |-
62+
```yaml
63+
redis_version: "5.0.3"
64+
redis_user: redis
65+
redis_group: redis
66+
mount_path: /data
67+
redis_server_opt_dir: "/opt/redis-server"
68+
redis_server_config_dir: "{{ redis_server_opt_dir }}/config"
69+
redis_server_log_dir: "/var/log/redis"
70+
redis_server_data_dir: "{{ mount_path }}/redis-server"
71+
redis_server_bind: 0.0.0.0
72+
redis_server_port: 6379
73+
redis_server_password: false
74+
redis_server_min_slaves_to_write: 0
75+
redis_server_min_slaves_max_lag: 10
76+
redis_server_tcp_backlog: 10000
77+
redis_server_tcp_keepalive: 20
78+
redis_server_maxclients: 30000
79+
redis_server_timeout: 0
80+
redis_server_slaveof: false
81+
redis_server_slave_read_only: "yes"
82+
redis_server_slave_priority: 100
83+
redis_server_repl_backlog_size: false
84+
redis_server_dir: /var/lib/redis
85+
redis_server_logfile: '"/var/log/redis/redis-server.log"'
86+
redis_server_databases: 16
87+
redis_server_loglevel: notice
88+
redis_server_slowlog_log_slower_than: 10000
89+
redis_server_slowlog_max_len: 128
90+
redis_server_maxmemory: false
91+
redis_server_maxmemory_policy: noeviction
92+
redis_server_rename_commands: []
93+
redis_server_save:
94+
- 900 1
95+
- 300 10
96+
- 60 10000
97+
redis_server_stop_writes_on_bgsave_error: "yes"
98+
redis_server_rdbcompression: "yes"
99+
redis_server_rdbchecksum: "yes"
100+
redis_server_appendonly: "no"
101+
redis_server_appendfilename: "appendonly.aof"
102+
redis_server_appendfsync: "everysec"
103+
redis_server_no_appendfsync_on_rewrite: "no"
104+
redis_server_auto_aof_rewrite_percentage: "100"
105+
redis_server_auto_aof_rewrite_min_size: "64mb"
106+
redis_server_notify_keyspace_events: '""'
107+
```
108+
109+
# How to install project
110+
installation: |-
111+
```console
112+
$ ansible-galaxy install clouddrove.ansible_role_docker_redis
113+
```

defaults/main.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
---
2+
# redis version
3+
redis_version: "5.0.3"
24

3-
redis_datadir: /data/lib/redis
4-
5+
# Users & groups
56
redis_user: redis
67
redis_group: redis
78

9+
# Configurations
10+
mount_path: /data
811
redis_server_opt_dir: "/opt/redis-server"
912
redis_server_config_dir: "{{ redis_server_opt_dir }}/config"
10-
redis_server_log_dir: "{{ mount_path }}/log/redis-server"
11-
redis_server_data_dir: "{{ mount_path }}/var/lib/redis-server"
12-
redis_version: "5.0.3"
13-
## Networking/connection options
13+
redis_server_log_dir: "/var/log/redis"
14+
redis_server_data_dir: "{{ mount_path }}/redis-server"
15+
16+
# Networking/connection options
1417
redis_server_bind: 0.0.0.0
1518
redis_server_port: 6379
1619
redis_server_password: false
20+
1721
# Slave replication options
1822
redis_server_min_slaves_to_write: 0
1923
redis_server_min_slaves_max_lag: 10
2024
redis_server_tcp_backlog: 10000
2125
redis_server_tcp_keepalive: 20
26+
2227
# Max connected clients at a time
2328
redis_server_maxclients: 30000
2429
redis_server_timeout: 0
2530

2631
## Replication options
2732
# Set slaveof just as you would in redis.conf. (e.g. "redis01 6379")
2833
redis_server_slaveof: false
34+
2935
# Make slaves read-only. "yes" or "no"
3036
redis_server_slave_read_only: "yes"
3137
redis_server_slave_priority: 100

0 commit comments

Comments
 (0)