Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
felbinger committed Jun 1, 2024
1 parent 2c5ba14 commit 3f06f1d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -358,5 +358,3 @@ $RECYCLE.BIN/

.keys/*
!.keys/.gitkeep

_examples.tar.gz
Empty file removed .gitmodules
Empty file.
6 changes: 3 additions & 3 deletions inventory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ all:
# server_type: cax11
# image: rocky-9

alma:
server_type: cax11
image: alma-9
# alma:
# server_type: cax11
# image: alma-9

# centos:
# server_type: cax11
Expand Down
4 changes: 3 additions & 1 deletion tasks/local/hetzner-cloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
when: server_info.ipv4_address is defined or server_info.ipv6 is defined
ansible.builtin.add_host:
name: "{{ item }}"
ansible_host: "{{ (server_info.ipv6 | ansible.netcommon.ipmath(1)) | default(server_info.ipv4_address) }}"
ansible_host: "{{ ipv6_address | default(server_info.ipv4_address) }}"
ansible_user: "{{ ('new' in server_info.labels) | ternary('root', worker_user) }}"
ansible_sudo_pass: "{{ worker_password }}"
groups: ["all"]
Expand All @@ -64,6 +64,8 @@
# this contains multiple entries, which we need to filter by the hostname
# (item), before we can access ipv6 and ipv6_address on it.
server_info: "{{ output.hcloud_server_info | selectattr('name', 'equalto', item) | first }}"
# ipmath module requires a valid ip net to operate
ipv6_address: "{{ server_info.ipv6 | ansible.utils.ipmath(1)) if server_info.ipv6 != '' else '' }}"
loop: "{{ vars['groups']['all'] }}"
changed_when: false

Expand Down

0 comments on commit 3f06f1d

Please sign in to comment.