Skip to content

Commit

Permalink
chore: Fix names in roles
Browse files Browse the repository at this point in the history
Signed-off-by: Mahendra Paipuri <[email protected]>
  • Loading branch information
mahendrapaipuri committed Feb 24, 2024
1 parent 6fc63bc commit c384424
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 42 deletions.
4 changes: 2 additions & 2 deletions roles/ceems_api_server/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ argument_specs:
description:
- I(Advanced)
- System group for batch job stats server
default: batchjob-stats
default: ceems
ceems_api_server_system_user:
description:
- I(Advanced)
- CEEMS API server user
default: batchjob-stats
default: ceems
ceems_api_server_cli_args:
description:
- I(Advanced)
Expand Down
6 changes: 3 additions & 3 deletions roles/ceems_exporter/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ argument_specs:
ceems_exporter_system_group:
description:
- I(Advanced)
- System group for batch job exporter
default: ceems-exp
- System group for CEEMS exporter
default: ceemsexp
ceems_exporter_system_user:
description:
- I(Advanced)
- CEEMS exporter user
default: ceems-exp
default: ceemsexp
ceems_exporter_cli_args:
description:
- I(Advanced)
Expand Down
2 changes: 1 addition & 1 deletion roles/ceems_lb/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ ceems_lb_db_path: ""
ceems_lb_cli_args: []
ceems_lb_env_vars: {}
ceems_lb_binary_install_dir: /usr/local/bin
ceems_lb_system_group: ceems
ceems_lb_system_group: ceemslb
ceems_lb_system_user: "{{ ceems_lb_system_group }}"
4 changes: 2 additions & 2 deletions roles/ceems_lb/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ argument_specs:
description:
- I(Advanced)
- System group for batch job stats server
default: batchjob-stats
default: ceemslb
ceems_lb_system_user:
description:
- I(Advanced)
- CEEMS Load Balancer user
default: batchjob-stats
default: ceemslb
ceems_lb_cli_args:
description:
- I(Advanced)
Expand Down
25 changes: 13 additions & 12 deletions roles/ceems_lb/molecule/alternative/tests/test_alternative.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

def test_directories(host):
dirs = [
"/var/lib/ceems_api_server",
"/tmp/ceems_api_server"
"/var/lib/ceems_lb",
"/tmp/ceems_lb"
]
for dir in dirs:
d = host.file(dir)
Expand All @@ -21,8 +21,9 @@ def test_directories(host):

def test_files(host):
files = [
"/etc/systemd/system/ceems_api_server.service",
"/usr/local/bin/ceems_api_server"
"/etc/systemd/system/ceems_lb.service",
"/etc/ceems_lb/config.yaml",
"/usr/local/bin/ceems_lb"
]
for file in files:
f = host.file(file)
Expand All @@ -46,27 +47,27 @@ def test_permissions_didnt_change(host):


def test_user(host):
assert host.group("batchjob-stats").exists
assert "batchjob-stats" in host.user("batchjob-stats").groups
assert host.user("batchjob-stats").shell == "/usr/sbin/nologin"
assert host.user("batchjob-stats").home == "/"
assert host.group("ceemslb").exists
assert "ceemslb" in host.user("ceemslb").groups
assert host.user("ceemslb").shell == "/usr/sbin/nologin"
assert host.user("ceemslb").home == "/"


def test_service(host):
s = host.service("ceems_api_server")
s = host.service("ceems_lb")
try:
assert s.is_running
except AssertionError:
# Capture service logs
journal_output = host.run('journalctl -u ceems_api_server --since "1 hour ago"')
print("\n==== journalctl -u ceems_api_server Output ====\n")
journal_output = host.run('journalctl -u ceems_lb --since "1 hour ago"')
print("\n==== journalctl -u ceems_lb Output ====\n")
print(journal_output)
print("\n============================================\n")
raise # Re-raise the original assertion error


def test_systemd_properties(host):
s = host.service("ceems_api_server")
s = host.service("ceems_lb")
p = s.systemd_properties
assert p.get("ProtectHome") == "yes"
assert p.get("Environment") == "foo=bar"
Expand Down
23 changes: 12 additions & 11 deletions roles/ceems_lb/molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def test_directories(host):
dirs = [
"/var/lib/ceems_api_server"
"/var/lib/ceems_lb"
]
for dir in dirs:
d = host.file(dir)
Expand All @@ -20,8 +20,9 @@ def test_directories(host):

def test_files(host):
files = [
"/etc/systemd/system/ceems_api_server.service",
"/usr/local/bin/ceems_api_server"
"/etc/systemd/system/ceems_lb.service",
"/etc/ceems_lb/config.yaml",
"/usr/local/bin/ceems_lb"
]
for file in files:
f = host.file(file)
Expand All @@ -45,27 +46,27 @@ def test_permissions_didnt_change(host):


def test_user(host):
assert host.group("ceems").exists
assert "ceems" in host.user("ceems").groups
assert host.user("ceems").shell == "/usr/sbin/nologin"
assert host.user("ceems").home == "/"
assert host.group("ceemslb").exists
assert "ceemslb" in host.user("ceemslb").groups
assert host.user("ceemslb").shell == "/usr/sbin/nologin"
assert host.user("ceemslb").home == "/"


def test_service(host):
s = host.service("ceems_api_server")
s = host.service("ceems_lb")
try:
assert s.is_running
except AssertionError:
# Capture service logs
journal_output = host.run('journalctl -u ceems_api_server --since "1 hour ago"')
print("\n==== journalctl -u ceems_api_server Output ====\n")
journal_output = host.run('journalctl -u ceems_lb --since "1 hour ago"')
print("\n==== journalctl -u ceems_lb Output ====\n")
print(journal_output)
print("\n============================================\n")
raise # Re-raise the original assertion error


def test_protecthome_property(host):
s = host.service("ceems_api_server")
s = host.service("ceems_lb")
p = s.systemd_properties
assert p.get("ProtectHome") == "yes"

Expand Down
23 changes: 12 additions & 11 deletions roles/ceems_lb/molecule/latest/tests/test_latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def test_directories(host):
dirs = [
"/var/lib/ceems_api_server"
"/var/lib/ceems_lb"
]
for dir in dirs:
d = host.file(dir)
Expand All @@ -20,8 +20,9 @@ def test_directories(host):

def test_files(host):
files = [
"/etc/systemd/system/ceems_api_server.service",
"/usr/local/bin/ceems_api_server"
"/etc/systemd/system/ceems_lb.service",
"/etc/ceems_lb/config.yaml",
"/usr/local/bin/ceems_lb"
]
for file in files:
f = host.file(file)
Expand All @@ -45,27 +46,27 @@ def test_permissions_didnt_change(host):


def test_user(host):
assert host.group("ceems").exists
assert "ceems" in host.user("ceems").groups
assert host.user("ceems").shell == "/usr/sbin/nologin"
assert host.user("ceems").home == "/"
assert host.group("ceemslb").exists
assert "ceemslb" in host.user("ceemslb").groups
assert host.user("ceemslb").shell == "/usr/sbin/nologin"
assert host.user("ceemslb").home == "/"


def test_service(host):
s = host.service("ceems_api_server")
s = host.service("ceems_lb")
try:
assert s.is_running
except AssertionError:
# Capture service logs
journal_output = host.run('journalctl -u ceems_api_server --since "1 hour ago"')
print("\n==== journalctl -u ceems_api_server Output ====\n")
journal_output = host.run('journalctl -u ceems_lb --since "1 hour ago"')
print("\n==== journalctl -u ceems_lb Output ====\n")
print(journal_output)
print("\n============================================\n")
raise # Re-raise the original assertion error


def test_protecthome_property(host):
s = host.service("ceems_api_server")
s = host.service("ceems_lb")
p = s.systemd_properties
assert p.get("ProtectHome") == "yes"

Expand Down

0 comments on commit c384424

Please sign in to comment.