Skip to content

Contains Ansible playbooks for CentOS, Debian and Ubuntu. Uses Docker, Docker Compose, Ansible Vault and secure setup for environment variables. Provides a wide range of Docker Compose scripts too, integrated with Ansible Vault for secure variables.

License

Notifications You must be signed in to change notification settings

namikazebadri/ansible-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Scripts

This repository Contains Ansible playbooks for CentOS, Debian and Ubuntu. Uses Docker, Docker Compose, Ansible Vault and secure setup for environment variables. Provides a wide range of Docker Compose scripts too, integrated with Ansible Vault for secure variables.

Requirements

Make sure public key in the local machine is registered to the authorized_keys file in your server(s), so Ansible can do ssh to your servers.

What You Need to Know About This Ansible Scripts

This Ansible project layout assumes these conditions:

  1. The Ansible variables file is located at ~/ansible/vars.yml in the local machine (as stated in docker.yml files).
  2. Default vault password is the_fault_is_our_stars and vault file is assume t be stored at ~/.vault_pass.txt, change it with your own vault password with Ansible rekey command or simply decrypt the files and encrypt with new vault password.
  3. Environment variables file to be set in remote machines is located at ./vars/vaults/envvars.
  4. Environment variables file for Docker compose is located at ./vars/vaults/.env.
  5. Docker compose files located at ./vars/composes directory.
  6. You can add your own docker compose files at ./vars/composes directory and add them to Run compose file(s) task's vars.

Change Inventory

To change inventory, please edit os-name/inventory/host.yml to represent your servers inventory. Please refer to this documentation from Ansible for the syntax and rules.

Executing The Playbook

Let's say we want to run Ansible for Ubuntu 20.04 server:

cd ubuntu20.04

ansible-playbook -i inventory \
    --vault-password-file ~/.vault_pass.txt \
    docker.yml

Run Other Containers

You can run any other containers listed in the compose folder in this repository. These files are coming from this gist.

About

Contains Ansible playbooks for CentOS, Debian and Ubuntu. Uses Docker, Docker Compose, Ansible Vault and secure setup for environment variables. Provides a wide range of Docker Compose scripts too, integrated with Ansible Vault for secure variables.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages