<commit_before># ansible-module-etcd
Ansible Module to manage ETCD Keys and Values, also a Lookup plugin

## Requirements
- Ansible >= 2.1
- python-etcd package
- python-requests package
- Docker (optional, Just to try the module)

### Fedora
```
sudo dnf install ansible python2-requests python2-python-etcd
```

### Virtualenv
```
sudo dnf install python2-virtualenv
virtualenv -p python2 .virtualenv
source .virtualenv/bin/activate
pip install requests python-etcd ansible
```

## How to try
### 1. Start a ETCD server
We will work with Docker, execute this commands to start a new etcd server:

```
docker pull quay.io/coreos/etcd:latest
export HostIP='MyIP'
docker run -it --rm -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 --name etcd quay.io/coreos/etcd etcd --name etcd0 -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -initial-advertise-peer-urls http://${HostIP}:2380 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd0=http://${HostIP}:2380 -initial-cluster-state new
```

### 2. Prepare the environment & Execution
I will assume that we already have all the requirements fullfiled (docker daemon up and all this stuff)

```
git clone https://github.com/padajuan/ansible-module-etcd.git
cd ansible-module-etcd
ansible-playbook -i inv sample.yml -u <username>
```

**Output**:
```
PLAY [Sampple for ETCD Module] *************************************************
<commit_msg>Changed README modified request library<commit_after># ansible-module-etcd
Ansible Module to manage ETCD Keys and Values, also a Lookup plugin

## Requirements
- Ansible >= 2.1
- python-etcd package
- Docker (optional, Just to try the module)

### Fedora
```
sudo dnf install ansible python2-requests python2-python-etcd
```

### Virtualenv
```
sudo dnf install python2-virtualenv
virtualenv -p python2 .virtualenv
source .virtualenv/bin/activate
pip install python-etcd ansible
```

## How to try
### 1. Start a ETCD server
We will work with Docker, execute this commands to start a new etcd server:

```
docker pull quay.io/coreos/etcd:latest
export HostIP='MyIP'
docker run -it --rm -v /usr/share/ca-certificates/:/etc/ssl/certs -p 4001:4001 -p 2380:2380 -p 2379:2379 --name etcd quay.io/coreos/etcd etcd --name etcd0 -advertise-client-urls http://${HostIP}:2379,http://${HostIP}:4001 -listen-client-urls http://0.0.0.0:2379,http://0.0.0.0:4001 -initial-advertise-peer-urls http://${HostIP}:2380 -listen-peer-urls http://0.0.0.0:2380 -initial-cluster-token etcd-cluster-1 -initial-cluster etcd0=http://${HostIP}:2380 -initial-cluster-state new
```

### 2. Prepare the environment & Execution
I will assume that we already have all the requirements fullfiled (docker daemon up and all this stuff)

```
git clone https://github.com/padajuan/ansible-module-etcd.git
cd ansible-module-etcd
ansible-playbook -i inv sample.yml -u <username>
```

**Output**:
```
PLAY [Sampple for ETCD Module] *************************************************

{'fraction_non_alphanumeric': 0.16769180964713498, 'fraction_numerical': 0.048559404337973455, 'mean_word_length': 4.411558669001751, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1578965', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1032, 'n_words': 301}