Skip to content

Commit

Permalink
ansible: use rust binary for facts instead of python and bash scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Jul 23, 2024
1 parent aa6f402 commit 62cf2fa
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 223 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### Ansible ###
/backup.lock
/ansible_facts.d/saltbox.fact

# Vars
/inventories/host_vars/*
Expand Down
35 changes: 0 additions & 35 deletions ansible_facts.d/group.fact

This file was deleted.

102 changes: 0 additions & 102 deletions ansible_facts.d/network.fact

This file was deleted.

20 changes: 0 additions & 20 deletions ansible_facts.d/timezone.fact

This file was deleted.

42 changes: 0 additions & 42 deletions ansible_facts.d/user.fact

This file was deleted.

37 changes: 13 additions & 24 deletions inventories/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,45 +119,34 @@ downloads_custom_path: "{{ false
# User
################################

uid: "{{ ansible_local.user[user.name].uid }}"

gid: "{{ ansible_local.user[user.name].gid }}"

vgid: "{{ ansible_local.group.video.gid }}"

rgid: "{{ ansible_local.group.render.gid }}"

dockergid: "{{ ansible_local.group.docker.gid }}"
uid: "{{ ansible_local.saltbox.users[user.name].uid }}"
gid: "{{ ansible_local.saltbox.users[user.name].gid }}"
vgid: "{{ ansible_local.saltbox.groups.video.gid }}"
rgid: "{{ ansible_local.saltbox.groups.render.gid }}"
dockergid: "{{ ansible_local.saltbox.groups.docker.gid }}"

################################
# Timezone
################################

tz: "{{ system.timezone
if system is defined and system.timezone is defined and 'auto' not in system.timezone | lower
else ansible_local.timezone.timezone
if ansible_local is defined and ansible_local.timezone is defined and ansible_local.timezone.timezone is defined and ansible_local.timezone.timezone | trim | length > 0
else ansible_local.saltbox.timezone.timezone
if ansible_local is defined and ansible_local.saltbox.timezone is defined and ansible_local.saltbox.timezone.timezone is defined and ansible_local.saltbox.timezone.timezone | trim | length > 0
else 'Etc/UTC' }}"

################################
# Network
################################

ip_address_host: "0.0.0.0"

ip_address_localhost: "127.0.0.1"

ip_address_public: "{{ ansible_local.network.ip.public_ip }}"

ip_address_public_is_valid: "{{ false if ansible_local.network.ip.failed_ipv4 else true }}"

ip_address_public_error: "{{ ansible_local.network.ip.error_ipv4 }}"

ipv6_address_public: "{{ ansible_local.network.ip.public_ipv6 }}"

ipv6_address_public_is_valid: "{{ false if ansible_local.network.ip.failed_ipv6 else true }}"

ipv6_address_public_error: "{{ ansible_local.network.ip.error_ipv6 }}"
ip_address_public: "{{ ansible_local.saltbox.ip.public_ip }}"
ip_address_public_is_valid: "{{ false if ansible_local.saltbox.ip.failed_ipv4 else true }}"
ip_address_public_error: "{{ ansible_local.saltbox.ip.error_ipv4 }}"
ipv6_address_public: "{{ ansible_local.saltbox.ip.public_ipv6 }}"
ipv6_address_public_is_valid: "{{ false if ansible_local.saltbox.ip.failed_ipv6 else true }}"
ipv6_address_public_error: "{{ ansible_local.saltbox.ip.error_ipv6 }}"

################################
# Theme
Expand Down

0 comments on commit 62cf2fa

Please sign in to comment.