$ uname -r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
| The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
| The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
| To use: | |
| 1. Install [Ansible](https://www.ansible.com/) | |
| 2. Setup an Ubuntu 16.04 server accessible over ssh | |
| 3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
| 4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| # | |
| # This script can be executed to bootstrap a clean OpenBSD installation | |
| # so that it can be managed via Ansible. | |
| # | |
| # Enter the root password when prompted (twice) | |
| # | |
| # NB: Assumes $TARGET_HOST has already been added to inventory and | |
| # appropriate groups, and that variables are set as necessary | |
| # (e.g. ansible_become_method, ansible_python_interpreter, etc.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #To Decrypt Jenkins Password from credentials.xml | |
| #<username>jenkins</username> | |
| #<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase> | |
| #go to the jenkins url | |
| http://jenkins-host/script | |
| #In the console paste the script | |
| hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J' |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
Press minus + shift + s and return to chop/fold long lines!