Skip to content

Commit

Permalink
use ansible controller to detect latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
bodsch committed Sep 13, 2022
1 parent ef1ffc8 commit 62ebf70
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 102 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ on:
- "code linter"
branches:
- main
- feature/*
- fix/*
- feature/**
- fix/**
types:
- completed

Expand Down
92 changes: 0 additions & 92 deletions molecule/default/group_vars/all/vars.yml
Original file line number Diff line number Diff line change
@@ -1,95 +1,3 @@
---

# glauth_version: latest

glauth_service:
listen:
ldap: ""
ldaps: ""
tls:
cert_file: "/etc/glauth/certs/molecule.lan.pem"
key_file: "/etc/glauth/certs/molecule.lan.key"

glauth_config:
ldaps:
enabled: false
listen:
address: "0.0.0.0"
port: "636"
tls:
cert_file: "/etc/glauth/certs/molecule.lan.pem"
key_file: "/etc/glauth/certs/molecule.lan.key"

glauth_backends:
config:
base_dn: "dc=molecule,dc=lan"
name_format: "cn"
group_format: "ou"

glauth_groups:
admins:
gid: 3000
vpn:
gid: 3001
users:
gid: 6000
include_groups:
- 3001

glauth_users:
admin:
enabled: true
given_name: Admin
sn: ""
mail: "[email protected]"
uid: 3000
primary_group: 3000
other_groups: []
pass:
sha256: "6b7556f632dc73ea7470a0116d6e55880fda6ca50575b72c7cc5f13df53a2623"
sha256_apps: []
bcrypt: ""
bcrypt_apps: []
ssh_keys: []
otp_secret: ""
yubikey: ""
login_shell: ""
home_dir: ""
capabilities:
# "*":
# object: "dc=matrix,dc=lan"
"*":
object: "dc=molecule,dc=lan"
custom_attrs: {}

bodsch:
given_name: "B."
sn: "Schulz"
uid: 6000
primary_group: 6000
other_groups:
- 3001
pass:
sha256: "6b7556f632dc73ea7470a0116d6e55880fda6ca50575b72c7cc5f13df53a2623"
sha256_apps:
- "fc6be9b218afa2ce37409580b8a4907feb6c1ea878d1222e4d2b84e81c1c0e47"
- "cd2eb0837c9b4c962c22d2ff8b5441b7b45805887f051d39bf133b583baf6860"
ssh_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPHUuPrbu9kSKL1u0gfViSa/P7FkZPk8hYbv7hegpTcY [email protected]"
login_shell: "/bin/bash"
home_dir: "/home/bodsch"
capabilities:
# "search":
# object: "dc=matrix,dc=lan"
"search":
object: "dc=molecule,dc=lan"

glauth_behaviors:
ignore_capabilities: true

glauth_api:
enabled: true
listen:
address: "0.0.0.0"

...
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ provisioner:
# - -vv
config_options:
defaults:
deprecation_warnings: True
deprecation_warnings: true
stdout_callback: yaml

scenario:
Expand Down
1 change: 0 additions & 1 deletion molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@

roles:
- role: syslog-ng
- role: snakeoil

...
5 changes: 1 addition & 4 deletions molecule/default/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---

- name: snakeoil
src: bodsch.snakeoil
version: 1.2.4

- name: syslog-ng
src: bodsch.syslog_ng
version: 1.4.0

...
2 changes: 2 additions & 0 deletions tasks/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- name: download glauth binary archive
become: false
delegate_to: "{{ glauth_delegate_to }}"
run_once: "{{ 'false' if glauth_direct_download else 'true' }}"
get_url:
url: "{{ glauth_release_download_url }}/download/v{{ glauth_version }}/{{ ansible_facts.system }}{{ system_architecture }}.zip"
dest: "{{ glauth_local_tmp_directory }}/glauth-{{ system_architecture }}.zip"
Expand All @@ -27,6 +28,7 @@
- name: extract glauth archive
become: false
delegate_to: "{{ glauth_delegate_to }}"
run_once: "{{ 'false' if glauth_direct_download else 'true' }}"
unarchive:
src: "{{ glauth_local_tmp_directory }}/glauth-{{ system_architecture }}.zip"
dest: "{{ glauth_local_tmp_directory }}"
Expand Down
3 changes: 3 additions & 0 deletions tasks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@

- block:
- name: get latest release
delegate_to: localhost
become: false
run_once: true
uri:
url: "https://api.github.com/repos/glauth/glauth/releases/latest"
method: GET
Expand Down
3 changes: 1 addition & 2 deletions templates/init/openrc/conf.d/glauth.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ group="{{ glauth_system_group }}"

command_args="
{% if glauth_service is defined %}
--config {{ glauth_config_dir }}/glauth.conf
{% endif %}
--config {{ glauth_config_dir }}/glauth.conf
"

0 comments on commit 62ebf70

Please sign in to comment.