My adventure with Ansible.
Go to file
James Tombleson d14c2aaa2c
Dev (#9)
* docker tests are looking good and nfs is able to connect and containers can talk to each other.

* Added pihole support for a new vm

* pihole is not working yet via docker.  Installed it by hand without ansible for now.

* added some docker related tasks and working on collins now to see how to use it.

* forgot to push some changes... kube didnt work out as it adds too much overhead for what I need.

* added two roles to help working with backup and restore of docker volume data.

* did some cleanup on old roles.

* pushing for axw testing

* moving to requirements.yml. adding cron jobs for maint.

* roles are being moved out of this repo.  Roles are handled by requirements.yml going forward. Dev roles are still in the repo but if they stick around a new repo will be made for it.

* Made a bunch of changes

* fixed a problem

* Added a playbook to deploy grafana and added prometheus role to monitor things.

* Updated cron to test

* Updated cron to test

* Updated cron

* updated discord_webhook and now testing if cron will pick up the changes.

* Fixed plex backup for now.

* docker updates and working on nginx

* pushing pending changes that need to go live for cron testing

* fixed debug roles and updated discord test

* fixed debug roles and updated discord test

* Disabling test cron

* its been awhile... I am not sure what I have done anymore but time to push my changes.

* added newsbot configs, added to jenkins, starting to migrate to collections.

* Updated inventory to support the network changes

* jenkinsfile is now working in my local setup.

* node2 is unhealthy and is removed from inv.  I was doing something to this box months ago, but now i dont remember what it was."

* updated images and adding them to jenkins for testing

* removed the old image files and moved to my public image

* Jenkins will now inform discord of jobs. Added post tasks. Added mediaserver common.

* updated the backend update job and adding a jenkins pipeline to handle it for me.

* updated the backup job again

* Updated all the jekins jobs.  Added a jenkins newsbot backup job.  Adjusted newsbot plays to add backup and redeploy jobs.

* updated newsbot backup playbook to make older backup files as needed.

* Added debug message to report in CI what version is getting deployed.

* I did something stupid and this device is not letting me login for now.

* removing twitter source for now as I found a bandwidth related bug that wont get pushed for a bit

* Adding a bunch of changes, some is cleanup and some are adds

* updated the images

* updated the kube common playbook

* Started to work on ceph, stopped due to hardware resources, updated common, added monit, and starting to work on a playbook to handle my ssh access.

* Added a role to deploy monit to my servers.  Still needs some more updates before its ready

* Here is my work on ceph, it might go away but I am not sure yet.

* Starting to migrate my common playbook to a role, not done yet.

* updated kube and inventory

* updated gitignore
2022-01-28 16:22:11 -08:00
.devcontainer Dev (#9) 2022-01-28 16:22:11 -08:00
.vscode Dev (#9) 2022-01-28 16:22:11 -08:00
ci Dev (#9) 2022-01-28 16:22:11 -08:00
docs Updated docs 2019-10-20 15:46:43 -07:00
examples Updated docs 2019-10-20 15:46:43 -07:00
inventory Dev (#9) 2022-01-28 16:22:11 -08:00
modules Dev (#9) 2022-01-28 16:22:11 -08:00
playbook Dev (#9) 2022-01-28 16:22:11 -08:00
roles Dev (#9) 2022-01-28 16:22:11 -08:00
.gitignore Dev (#9) 2022-01-28 16:22:11 -08:00
README.md Starting to get back on the saddle... Looking at getting AWX installed at home so I can use that over something like Jenkins... maybe 2019-10-18 19:27:09 -07:00
ansible.cfg Dev (#9) 2022-01-28 16:22:11 -08:00
jenkinsfile Dev (#9) 2022-01-28 16:22:11 -08:00
makefile Dev (#9) 2022-01-28 16:22:11 -08:00
requirements.yml Dev (#9) 2022-01-28 16:22:11 -08:00

README.md

Ansible

This repo contains my configuration and setup for my ansible use. Use at your own risk.

  1. Install Ansible on development device
  2. Clone this repository to work in
  3. Configure devices to remote into
  4. Configure Ansible's Inventory files
  5. Set Vault Secret
  6. Run Connection tests

Installers

New hosts

Linux

wget https://github.com/luther38/Ansible/blob/master/scripts/installAnsible.sh
chmod 777 installAnsible.sh
./installOpenSSH.sh

Windows

$url = "https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1"
$file = "$env:temp\ConfigureRemotingForAnsible.ps1"
(New-Object -TypeName System.Net.WebClient).DownloadFile($url, $file)
powershell.exe -ExecutionPolicy ByPass -File $file

Configuration

I have a basic configuration file in place at the root of this folder for anisble to find. If you work out of this directory the configuration file will take effect that is loaded.

Inventory

Inventory files have been moved over to .yml format. The ansibe.cfg is looking for ./dev.yml as it's default inventory file. For Prod use make another file that will contain all servers that will be managed.

I have a template file in place that should only be used as a reference. Make a copy of that file and name it hosts then update that file.

The configuration file that is active is looking for a directory that contains all of the inventory files. This way all files can be parted out rather then one big file.

Vault Secret

The configuration file is looking for ./.ansible_vault file to contain the secret for vault entries. Git is already configured to ignore this file. You will need to make this file and place your key in it so ansible can decrypt vaults as needed.

Run the following command and replace secret with your password. Once that is done move on to generating the encrypted strings.

echo 'secret' > ./.ansible_vault

To generate secure strings for the inventory file run the following command.

ansible-vault encrypt_string 'secret'

This will output the value that needs to be placed

Testing Linux devices

ansible linux -i hosts -m ping

Testing Windows devices

ansible windows -i hosts -m win_ping

Unit Testing

Still in the works