diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2025-08-24 13:31:38 +0100 |
---|---|---|
committer | Dmitry Ilvokhin <d@ilvokhin.com> | 2025-08-24 13:31:38 +0100 |
commit | 7d113fcddd341f1e4b04ceb2785087d50b8e1556 (patch) | |
tree | a8f8e8c288c13badf9eb061bbc67c899916bc6a3 /roles/dotfiles/tasks | |
parent | 461b380f51b6aca3113f581378846e4902bea6fe (diff) | |
download | infra-master.tar.gz infra-master.tar.bz2 infra-master.zip |
This is a simple role that works only for one host. There are multiple
complications that I should keep in mind in the future.
* There is should be a way to install dotfiles on boxes without GPG key
there. So, files with secrets in them should be gated.
* Wireguard configuration should be per host. Each host should have it
is own private key.
Diffstat (limited to 'roles/dotfiles/tasks')
-rw-r--r-- | roles/dotfiles/tasks/main.yml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml index 424588d..73c9a90 100644 --- a/roles/dotfiles/tasks/main.yml +++ b/roles/dotfiles/tasks/main.yml @@ -74,6 +74,29 @@ sshconfig_jumphost: '{{ dotfiles_jumphost }}' when: has_ssh.rc == 0 +- name: Configure wireguard if installed + tags: wireguard + block: + - name: Check if wireguard is installed + ansible.builtin.command: wg --version + changed_when: false + failed_when: false + register: has_wireguard + + - name: Get actual hostname + ansible.builtin.command: hostname + changed_when: false + failed_when: false + register: hostname + + - ansible.builtin.include_role: + name: wgconfig + vars: + wgconfig_user: '{{ dotfiles_user }}' + wgconfig_group: '{{ dotfiles_group }}' + wgconfig_homedir: '{{ dotfiles_homedir }}' + when: has_wireguard.rc == 0 and hostname.stdout == "silver" + - name: Configure git if installed tags: git block: |