Improve some minor parts of the code

This commit is contained in:
Thomas Kleinendorst 2024-04-11 11:13:29 +02:00
parent 90855de87a
commit 04c8038733
4 changed files with 10 additions and 7 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
cloudflare ddns/ddns_config.ini cloudflare ddns/ddns_config.ini
.vscode .vscode/launch.json
.vault_pass .vault_pass
.ansible_facts.json .ansible_facts.json
__pycache__ __pycache__

6
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,6 @@
{
"ansible.python.interpreterPath": "/home/thomas/python_venv/bin/python",
"files.associations": {
"*.yml": "ansible"
}
}

View file

@ -26,8 +26,6 @@
ssh_allow_users: 'thomas' 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_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. 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: tasks:
# This task can be handy for debugging gathered facts, uncomment it if necessary: # This task can be handy for debugging gathered facts, uncomment it if necessary:
# - name: Store gathered facts in local file # - name: Store gathered facts in local file
@ -36,7 +34,6 @@
# dest: './.ansible_facts.json' # dest: './.ansible_facts.json'
# content: "{{ ansible_facts }}" # content: "{{ ansible_facts }}"
# mode: "0600" # mode: "0600"
# TODO: Replace this with setup that sets up unnattended updates on the machine itself.
- name: Configure hostname - name: Configure hostname
become: true become: true
ansible.builtin.hostname: ansible.builtin.hostname:
@ -46,6 +43,7 @@
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /etc/hosts path: /etc/hosts
line: "{{ ansible_facts['default_ipv4']['address'] }} {{ hostname }}.kleinendorst.info {{ hostname }}" 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 - name: Update all packages to their latest version # noqa: package-latest
become: true become: true
ansible.builtin.apt: ansible.builtin.apt:

View file

@ -1,7 +1,6 @@
--- ---
- include_vars: vault.yml - name: Read local vault
# TODO: Configure ZSH correctly by reasusing the zsh role by running the commands as the new user. ansible.builtin.include_vars: vault.yml
# see: https://serverfault.com/questions/662443/running-ansible-task-as-a-specific-user
- name: Create a new user - name: Create a new user
ansible.builtin.include_role: ansible.builtin.include_role:
name: user name: user