Skip to content

Commit

Permalink
Merge pull request #1 from clouddrove/ops
Browse files Browse the repository at this point in the history
Ops
  • Loading branch information
anmolnagpal committed Aug 26, 2019
2 parents b7fe53b + 34689e9 commit b6f2dfe
Show file tree
Hide file tree
Showing 16 changed files with 399 additions and 54 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ignored files
.idea
*.iml
*.zip
molecule
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v2.2.3
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.0
hooks:
- id: ansible-lint
files: \.(yaml|yml)$
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Cloud Drove

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export GENIE_PATH ?= $(shell 'pwd')/../../../genie

include $(GENIE_PATH)/Makefile
170 changes: 170 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<!-- This file was automatically generated by the `geine`. Make all changes to `README.yaml` and run `make readme` to rebuild this file. -->


<p align="center"> <img src="https://user-images.githubusercontent.com/50652676/62451340-ba925480-b78b-11e9-99f0-13a8a9cc0afa.png" width="100" height="100"></p>

<h1 align="center">
Ansible Role Docker Redis
</h1>

<p align="center" style="font-size: 1.2rem;">
This ansible role is used to setup Redis server with docker on Debian.
</p>

<p align="center">

<a href="https://www.ansible.com">
<img src="https://img.shields.io/badge/Ansible-2.8-green?style=flat&logo=ansible" alt="Ansible">
</a>
<a href="LICENSE.md">
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="Licence">
</a>
<a href="https://ubuntu.com/">
<img src="https://img.shields.io/badge/ubuntu-16.x-orange?style=flat&logo=ubuntu" alt="Distribution">
</a>
<a href="https://ubuntu.com/">
<img src="https://img.shields.io/badge/ubuntu-18.x-orange?style=flat&logo=ubuntu" alt="Distribution">
</a>


</p>
<p align="center">

<a href='https://facebook.com/sharer/sharer.php?u=https://github.com/clouddrove/ansible-role-docker-redis'>
<img title="Share on Facebook" src="https://user-images.githubusercontent.com/50652676/62817743-4f64cb80-bb59-11e9-90c7-b057252ded50.png" />
</a>
<a href='https://www.linkedin.com/shareArticle?mini=true&title=Ansible+Role+Docker+Redis&url=https://github.com/clouddrove/ansible-role-docker-redis'>
<img title="Share on LinkedIn" src="https://user-images.githubusercontent.com/50652676/62817742-4e339e80-bb59-11e9-87b9-a1f68cae1049.png" />
</a>
<a href='https://twitter.com/intent/tweet/?text=Ansible+Role+Docker+Redis&url=https://github.com/clouddrove/ansible-role-docker-redis'>
<img title="Share on Twitter" src="https://user-images.githubusercontent.com/50652676/62817740-4c69db00-bb59-11e9-8a79-3580fbbf6d5c.png" />
</a>

</p>
<hr>



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.

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.



## Prerequisites

This module has a few dependencies:

- [Ansible2.8](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
- [Python](https://www.python.org/downloads)
- [Docker](https://docs.docker.com/install/linux/docker-ce/ubuntu)




## What Includes

Followiing things includes in this role:
- redis-cli
- redis-server







## Example Playbook

**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).


```yaml
- hosts: localhost
remote_user: ubuntu
become: true
roles:
- clouddrove.ansible_role_docker_redis
```


## Variables

```yaml
redis_version: "5.0.3"
redis_user: redis
redis_group: redis
mount_path: /data
redis_server_opt_dir: "/opt/redis-server"
redis_server_config_dir: "{{ redis_server_opt_dir }}/config"
redis_server_log_dir: "/var/log/redis"
redis_server_data_dir: "{{ mount_path }}/redis-server"
redis_server_bind: 0.0.0.0
redis_server_port: 6379
redis_server_password: false
redis_server_min_slaves_to_write: 0
redis_server_min_slaves_max_lag: 10
redis_server_tcp_backlog: 10000
redis_server_tcp_keepalive: 20
redis_server_maxclients: 30000
redis_server_timeout: 0
redis_server_slaveof: false
redis_server_slave_read_only: "yes"
redis_server_slave_priority: 100
redis_server_repl_backlog_size: false
redis_server_dir: /var/lib/redis
redis_server_logfile: '"/var/log/redis/redis-server.log"'
redis_server_databases: 16
redis_server_loglevel: notice
redis_server_slowlog_log_slower_than: 10000
redis_server_slowlog_max_len: 128
redis_server_maxmemory: false
redis_server_maxmemory_policy: noeviction
redis_server_rename_commands: []
redis_server_save:
- 900 1
- 300 10
- 60 10000
redis_server_stop_writes_on_bgsave_error: "yes"
redis_server_rdbcompression: "yes"
redis_server_rdbchecksum: "yes"
redis_server_appendonly: "no"
redis_server_appendfilename: "appendonly.aof"
redis_server_appendfsync: "everysec"
redis_server_no_appendfsync_on_rewrite: "no"
redis_server_auto_aof_rewrite_percentage: "100"
redis_server_auto_aof_rewrite_min_size: "64mb"
redis_server_notify_keyspace_events: '""'
```


## Installation

```console
$ ansible-galaxy install clouddrove.ansible_role_docker_redis
```






## Feedback
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).

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)!

## About us

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.

<p align="center">We are <b> The Cloud Experts!</b></p>
<hr />
<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>

[website]: https://clouddrove.com
[github]: https://github.com/clouddrove
[linkedin]: https://cpco.io/linkedin
[twitter]: https://twitter.com/clouddrove/
[email]: https://clouddrove.com/contact-us.html
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=
113 changes: 113 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#

# Name of this project
name: Ansible Role Docker Redis

# License of this project
license: "MIT"

# Canonical GitHub repo
github_repo: clouddrove/ansible-role-docker-redis

# Badges to display
badges:
- name: "Ansible"
image: "https://img.shields.io/badge/Ansible-2.8-green?style=flat&logo=ansible"
url: "https://www.ansible.com"
- name: "Licence"
image: "https://img.shields.io/badge/License-MIT-blue.svg"
url: "LICENSE.md"
- name: "Distribution"
image: "https://img.shields.io/badge/ubuntu-16.x-orange?style=flat&logo=ubuntu"
url: "https://ubuntu.com/"
- name: "Distribution"
image: "https://img.shields.io/badge/ubuntu-18.x-orange?style=flat&logo=ubuntu"
url: "https://ubuntu.com/"

# Prerequesties to display
# yamllint disable
prerequesties:
- name: "Ansible2.8"
url: "https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html"
- name: "Python"
url: "https://www.python.org/downloads"
- name: "Docker"
url: "https://docs.docker.com/install/linux/docker-ce/ubuntu"
# yamllint enable
# What Includes to display
what_includes:
- name: "redis-cli"
- name: "redis-server"


# description of this project
description: |-
This ansible role is used to setup Redis server with docker on Debian.
# How to use this project
usage: |-
```yaml
- hosts: localhost
remote_user: ubuntu
become: true
roles:
- clouddrove.ansible_role_docker_redis
```
# Variables use in the project
variables: |-
```yaml
redis_version: "5.0.3"
redis_user: redis
redis_group: redis
mount_path: /data
redis_server_opt_dir: "/opt/redis-server"
redis_server_config_dir: "{{ redis_server_opt_dir }}/config"
redis_server_log_dir: "/var/log/redis"
redis_server_data_dir: "{{ mount_path }}/redis-server"
redis_server_bind: 0.0.0.0
redis_server_port: 6379
redis_server_password: false
redis_server_min_slaves_to_write: 0
redis_server_min_slaves_max_lag: 10
redis_server_tcp_backlog: 10000
redis_server_tcp_keepalive: 20
redis_server_maxclients: 30000
redis_server_timeout: 0
redis_server_slaveof: false
redis_server_slave_read_only: "yes"
redis_server_slave_priority: 100
redis_server_repl_backlog_size: false
redis_server_dir: /var/lib/redis
redis_server_logfile: '"/var/log/redis/redis-server.log"'
redis_server_databases: 16
redis_server_loglevel: notice
redis_server_slowlog_log_slower_than: 10000
redis_server_slowlog_max_len: 128
redis_server_maxmemory: false
redis_server_maxmemory_policy: noeviction
redis_server_rename_commands: []
redis_server_save:
- 900 1
- 300 10
- 60 10000
redis_server_stop_writes_on_bgsave_error: "yes"
redis_server_rdbcompression: "yes"
redis_server_rdbchecksum: "yes"
redis_server_appendonly: "no"
redis_server_appendfilename: "appendonly.aof"
redis_server_appendfsync: "everysec"
redis_server_no_appendfsync_on_rewrite: "no"
redis_server_auto_aof_rewrite_percentage: "100"
redis_server_auto_aof_rewrite_min_size: "64mb"
redis_server_notify_keyspace_events: '""'
```
# How to install project
installation: |-
```console
$ ansible-galaxy install clouddrove.ansible_role_docker_redis
```
18 changes: 12 additions & 6 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
---
# redis version
redis_version: "5.0.3"

redis_datadir: /data/lib/redis

# Users & groups
redis_user: redis
redis_group: redis

# Configurations
mount_path: /data
redis_server_opt_dir: "/opt/redis-server"
redis_server_config_dir: "{{ redis_server_opt_dir }}/config"
redis_server_log_dir: "{{ mount_path }}/log/redis-server"
redis_server_data_dir: "{{ mount_path }}/var/lib/redis-server"
redis_version: "5.0.3"
## Networking/connection options
redis_server_log_dir: "/var/log/redis"
redis_server_data_dir: "{{ mount_path }}/redis-server"

# Networking/connection options
redis_server_bind: 0.0.0.0
redis_server_port: 6379
redis_server_password: false

# Slave replication options
redis_server_min_slaves_to_write: 0
redis_server_min_slaves_max_lag: 10
redis_server_tcp_backlog: 10000
redis_server_tcp_keepalive: 20

# Max connected clients at a time
redis_server_maxclients: 30000
redis_server_timeout: 0

## Replication options
# Set slaveof just as you would in redis.conf. (e.g. "redis01 6379")
redis_server_slaveof: false

# Make slaves read-only. "yes" or "no"
redis_server_slave_read_only: "yes"
redis_server_slave_priority: 100
Expand Down
Loading

0 comments on commit b6f2dfe

Please sign in to comment.