/laptop-provisioning

Quickly provision my laptop with preferred settings and configuration

Primary LanguageMakefile

Restore Laptop with Ansible

Usage

  1. Copy your SSH public key to roles/deploy_ssh_keys/public_keys/ (e.g. foo.pub)

  2. Deploy the SSH keys:

    make deploy-ssh-key
  3. Check the playbook

    make check-playbook
  4. Create an insecure file to hold your vault password:

    touch .secret.txt && chmod u=rw,go= .secret.txt
    $EDITOR .secret.txt # add your vault password
  5. Create a vault to hold your sudo password

    ansible-vault encrypt_string \
          --vault-password-file=.secret.txt \
          --stdin-name 'ansible_sudo_pass' \
          --output .secret.yml
  6. Run the playbook

    poetry shell
    # specific tag(s)
    make configure TAGS="foo,bar"
    
    # Top-level tags for roles
    make configure-<TAB>

Install

You can install everything you need with:

make  # install requirements, dependencies and dev-dependencies

Debug a Task

Register your task's output with:

 - name: Foo
       shell: echo bar
+      register: result

Then add a debug task after:

+- name: Print return information from the previous task
+  ansible.builtin.debug:
+    var: result

License

MIT