Collect Ansible roles for automatic deployment.
-
Ansible (version 2.5.6) should be installed first. In addition, we should also prepare an Ansible
inventory
file to run this playbook.Inventory File Example:
[servers] servers ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_user=vagrant ansible_ssh_private_key_file=.vagrant/machines/default/virtualbox/private_key
-
All roles are developed base on CentOS 6.7, ensure remote machines have the same OS.
-
Modify your Ansible playbook as needed.
Playbook Example:
--- - hosts: servers roles: - { role: dropwizard-api, become: yes } - { role: hubot, become: yes }
-
Copy vault-example.yml to vault.yml, modify values as necessary, and encrypt vault.yml:
$ ansible-vault encrypt vault.yml
and enter a password for the encrypted file when prompted.
- Run the Ansible playbook:
$ ansible-playbook -i inventory example-main.yml
and add --vault-id /path/to/vault/password-file
to specify vault password file or --vault-id @prompt
to be prompted for vault password
-
- Description: Create user and group for the API. Also, deploy the API repo to certain directories.
-
- Description: Generate / refresh certificates and backup old certificates.
-
- Description: Install Elasticsearch and ensure the service is running.
-
- Description: Removes dangling images and broken containers from the Docker environment. Backs up dangling images before removal.