No | Name | Version | Function |
---|---|---|---|
1 | Ansible | 2.8.4 or latest | Automation tools |
2 | Python | 3.6.8 or latest | Running SSH Key Gen script |
3 | SSHPASS | 1.06 or latest | Forced using password inline |
No | Name |
---|---|
1 | Terminator |
2 | Chrome |
3 | VSCode |
4 | Apache2 |
5 | MySQL |
6 | Virtualbox |
7 | PHP |
8 | Git |
9 | Tmux |
10 | pip3 |
11 | npm |
12 | Node.js |
13 | Htop |
>> Tested on Ubuntu Desktop 18.04 LTS
- Clone this repository
$ git clone https://github.com/cphikmawan/automation-sop-ajk-using-ansible
- Rename hosts.bak to hosts
$ mv hosts.bak hosts
- Rename hosts.json.bak with hosts.json
$ mv hosts.json.bak hosts.json
- Generate ssh-keygen on master host
$ ssh-keygen -t rsa
- Copy ssh-key-id to remoted host
$ ssh-copy-id username@host
- Try to ssh into remoted host
$ ssh username@host
If you want automation using script try to run gen.py
- Edit hosts.json with your remoted servers
- run gen.py
$ python3 gen.py
- Done
- Edit hosts file with remoted server what ever you want, example:
[workstation]
10.0.0.1 ansible_user=cloudy ansible_become_pass=secret
- Test connection from master host to remoted host
$ ansible workstation -m ping
- Success output
10.0.0.1 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python3"
},
"changed": false,
"ping": "pong"
}
- Run the playbook
$ ansible-playbook main.yml
- Enjoy :)
- Python3
- Virtualenv
- Pip3
- Flask
- Install pip3
$ sudo apt install python3-pip
- Install requirements
$ pip3 install -r requirements.txt
- Change directory to webs
$ cd webs
- Edit directory path on app.py
home = 'path/to/directory'
- Export
$ export FLASK_APP=app.py
$ export FLASK_ENV=development
$ flask run
- Access web on http://localhost:5000/
- https://docs.ansible.com/
- https://docs.ansible.com/ansible/latest/modules/apt_module.html
- https://docs.python.org/3/library/subprocess.html
- https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#latest-releases-via-apt-ubuntu
Created with <3 By Cloudy