Skip to content

davidasnider/ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible scripts for The Snider Pad

CI

Setup runtime/dev workstation

All configuration needed for development setup is in the Makefile.

make setup-dev

Activate Python Virtual Environment

Ansible is installed via Poetry. (this is done automatically in VS Code)

source .venv/bin/activate

Secrets

Secrets are stored in vault. We use the hashi_vault module to access those secrets. You must have a valid token stored in the VAULT_TOKEN variable, run these commands before running any of the below commands:

vault login -method=userpass username=ansible
export VAULT_TOKEN=$(cat ~/.vault-token)

Common use cases

Apply all playbooks

ansible-playbook site.yaml

Apply all playbooks to a specific group or host

In this case, we limit the run to nodes in the k8s2 group

ansible-playbook site.yaml -l k8s2

Rebuild the kubernetes clusters

NOTE: If you find that some of the nodes are not properly rebuilding, try resetting the iSCSI service on the TrueNas server.

```bash
ansible-playbook kubernetes/full_rebuild.yaml --extra-vars "cluster=k8s1"

Testing new versions of kubernetes

  1. It's likely a good idea to update the template node first
    1. Open Virtual Box, start server.template
    2. Login and run apt-get update && apt-get upgrade
  2. Delete the old test environment
    1. ./delete_test_env.sh
  3. Create the new test environment
    1. ./create_test_env.sh
  4. Bootstrap ansible
    1. ansible-playbook bootstrap/test-bootstrap.yaml -i test-inventory.yaml --extra-vars "cluster=k8stest"
  5. Install the latest playbooks
    1. ansible-playbook site.yaml -i test-inventory.yaml

Updating local pv-provisioner

   cd ~/code/sig-storage-local-static-provisioner
   git pull
   helm template ./helm/provisioner -f ./helm/provisioner/values.yaml --namespace pv-provisioner > ~/code/ansible/roles/prod_services/files/provisioner-generated.yaml

About

My Ansible repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •