Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tchapi/ansible-playbooks
Roles and playbooks for Ansible
https://github.com/tchapi/ansible-playbooks
ansible ansible-playbooks devops
Last synced: about 2 months ago
JSON representation
Roles and playbooks for Ansible
- Host: GitHub
- URL: https://github.com/tchapi/ansible-playbooks
- Owner: tchapi
- License: mit
- Created: 2014-04-27T19:13:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-04T19:11:27.000Z (10 months ago)
- Last Synced: 2024-10-07T17:13:06.843Z (3 months ago)
- Topics: ansible, ansible-playbooks, devops
- Language: Vim Script
- Homepage:
- Size: 283 KB
- Stars: 28
- Watchers: 4
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansible playbooks
A simple collection of roles and standard playbooks for deploying a common deployment / front application stack. These are mostly for PHP / Node + Caddy infrastructures, with MariaDB and Mongo database engines.
> NB : the default inventory file location is `/etc/ansible/hosts` on Linux, and `/usr/local/etc/ansible/hosts` on macOS
> You should include the ansible user to use when loging in, as so:```
[frontend_server]
my.frontend.server.com ansible_user=ubuntu
my.other.frontend.server.com ansible_user=ubuntu
```> NB : We use the following groups `[frontend_node]`, `[frontend_php]` in the playbooks.
## Roles available
- #### base
- Ensures that the server has at least some basics tools like `sudo` and `python-apt` for Ansible to run correctly.
- Updates and upgrades `apt`
- #### backup- Ensures a /var/backups/rolling folder is present
- Creates a DB + files backup script
- Creates a cron task for daily backups and uploads the backup somewhere safe (on a S3 compatible endpoint)> NB: You need to copy the `roles/backup/files/credentials.dist` file to `roles/backup/files/credentials` and put your provider credentials there. You might want to change the `region` too in `roles/backup/files/config` if needed.
- #### caddy
Ensures that `caddy`, is installed correctly and runs as a service.
- #### mongo
Ensures that `mongo-org` is the lastest and that the service is runnning correctly.
- #### node
Ensures that `node`, `npm` are installed correctly.
- #### maria_db
Ensures that `maria_db` is the lastest and that the service is runnning correctly. Adds a consistent `/root/.my.cnf` file for logging in.
- #### mlmmj
Installs postfix along with mlmmj using the configured MX domain. For more info on Mlmmj see [this blog post](http://www.foobarflies.io/a-simple-web-interface-for-mlmmj/)
- #### nginx
Ensures that `nginx` is the lastest and that the service is runnning correctly. Also uploads a secured configuration for `nginx`.
- #### php
Installs `php7.4` FPM and command line interface with a few standard modules, a sensible configuration file for cli and FPM, and the `composer` package manager.
- #### yarn
Ensures that `yarn` is installed correctly.
## Playbooks
The playbooks are rather straightforward.
> Before deploying a new server, you must make sure that your user has sudo rights, and that your SSH key is authorized for a password-less login
This done, when deploying a new nodeJS server for instance (on macOS):
ansible-playbook --inventory=/usr/local/etc/ansible/hosts playbooks/frontend_node.yml
#### mlmmj
This role is kind of "standalone". To use it, just play the mlmmj playbook alone, to install node and mlmmj in one go:
ansible-playbook --inventory=/usr/local/etc/ansible/hosts playbooks/mlmmj.yml
#### Reminder
If you want to execute a single shell command :
# Gets the speed of each cpu
ansible all -m shell -a "cat /proc/cpuinfo | grep MHz"## Licence
These roles and playbooks are released under the MIT licence. Enjoy !!