Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master into controller-job-status #243

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/saltbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ jobs:
- name: Symlink cloned repository to /srv/git/saltbox
run: sudo ln -s $GITHUB_WORKSPACE /srv/git/saltbox

- name: Install saltbox.fact
run: |
mkdir -p $GITHUB_WORKSPACE/ansible_facts.d
curl -fsSL https://github.com/saltyorg/ansible-facts/releases/latest/download/saltbox-facts -o $GITHUB_WORKSPACE/ansible_facts.d/saltbox.fact
chmod +x $GITHUB_WORKSPACE/ansible_facts.d/saltbox.fact

- name: Chown /srv/git
run: sudo chown -R runner:runner /srv/git

Expand Down
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.

3 changes: 0 additions & 3 deletions defaults/accounts.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ cloudflare:
dockerhub:
token:
user:
plex:
pass:
user:
user:
domain: testsaltbox.ml
email: [email protected]
Expand Down
26 changes: 26 additions & 0 deletions filter_plugins/plex_filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from ansible.errors import AnsibleFilterError
import os
import configparser

class FilterModule(object):
def filters(self):
return {
'check_plex_ini': self.check_plex_ini
}

def check_plex_ini(self, file_path, plex_name):
if not os.path.exists(file_path):
return {'exists': False, 'identifier': '', 'token': ''}

config = configparser.ConfigParser()
config.read(file_path)

if plex_name not in config.sections():
return {'exists': True, 'identifier': '', 'token': ''}

section = config[plex_name]
return {
'exists': True,
'identifier': section.get('client_identifier', ''),
'token': section.get('token', '')
}
49 changes: 16 additions & 33 deletions inventories/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,9 @@ cloudflare_is_enabled: "{{ (cloudflare is defined) and

cloudflare_records_enabled: "{{ cloudflare_is_enabled }}"

plex_account_is_enabled: "{{ (plex is defined) and
(plex is not none) and
(plex | trim | length > 0) and
(plex.user is defined) and
(plex.user is not none) and
(plex.user | trim | length > 0) and
(plex.pass is defined) and
(plex.pass is not none) and
(plex.pass | trim | length > 0) }}"
plex_account_lookup: "{{ '/opt/saltbox/plex.ini' | check_plex_ini(plex_instances[0]) }}"

plex_account_is_enabled: "{{ plex_account_lookup.exists and plex_account_lookup.identifier | length > 0 and plex_account_lookup.token | length > 0 }}"

################################
# Role Conditionals
Expand Down Expand Up @@ -119,45 +113,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
Loading