From 04c8038733a36940f45e5deecb45f3d64c2ae45f Mon Sep 17 00:00:00 2001 From: Thomas Kleinendorst Date: Thu, 11 Apr 2024 11:13:29 +0200 Subject: [PATCH] Improve some minor parts of the code --- .gitignore | 2 +- .vscode/settings.json | 6 ++++++ playbook.yml | 4 +--- roles/cloudflare-ddns/tasks/main.yml | 5 ++--- 4 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 644a107..bf5810c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ cloudflare ddns/ddns_config.ini -.vscode +.vscode/launch.json .vault_pass .ansible_facts.json __pycache__ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9dfb7de --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "ansible.python.interpreterPath": "/home/thomas/python_venv/bin/python", + "files.associations": { + "*.yml": "ansible" + } +} diff --git a/playbook.yml b/playbook.yml index 38635cc..a8b044a 100644 --- a/playbook.yml +++ b/playbook.yml @@ -26,8 +26,6 @@ ssh_allow_users: 'thomas' ssh_client_port: 22 # Default, but duplicated here for documentation purpose. Not changed because its only accessible via LAN. ssh_client_password_login: false # Default, but duplicated here for documentation purpose. - # Default for the "singleplatform-eng.users" role. - users_default_shell: '/usr/bin/zsh' tasks: # This task can be handy for debugging gathered facts, uncomment it if necessary: # - name: Store gathered facts in local file @@ -36,7 +34,6 @@ # dest: './.ansible_facts.json' # content: "{{ ansible_facts }}" # mode: "0600" - # TODO: Replace this with setup that sets up unnattended updates on the machine itself. - name: Configure hostname become: true ansible.builtin.hostname: @@ -46,6 +43,7 @@ ansible.builtin.lineinfile: path: /etc/hosts line: "{{ ansible_facts['default_ipv4']['address'] }} {{ hostname }}.kleinendorst.info {{ hostname }}" + # TODO: Replace this with setup that sets up unnattended updates on the machine itself. - name: Update all packages to their latest version # noqa: package-latest become: true ansible.builtin.apt: diff --git a/roles/cloudflare-ddns/tasks/main.yml b/roles/cloudflare-ddns/tasks/main.yml index bad6523..ec0a699 100644 --- a/roles/cloudflare-ddns/tasks/main.yml +++ b/roles/cloudflare-ddns/tasks/main.yml @@ -1,7 +1,6 @@ --- -- include_vars: vault.yml -# TODO: Configure ZSH correctly by reasusing the zsh role by running the commands as the new user. -# see: https://serverfault.com/questions/662443/running-ansible-task-as-a-specific-user +- name: Read local vault + ansible.builtin.include_vars: vault.yml - name: Create a new user ansible.builtin.include_role: name: user