mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-17 22:14:25 +02:00
Solved bug which existed due to user structure refactoring
This commit is contained in:
parent
e7322a239e
commit
73329506a9
5
Makefile
5
Makefile
@ -7,9 +7,10 @@ INCLUDES_OUT := ./tasks/utils/server-roles.yml
|
||||
INCLUDES_SCRIPT := ./cli/generate_playbook.py
|
||||
|
||||
EXTRA_USERS := $(shell \
|
||||
find $(ROLES_DIR) -maxdepth 1 -type d -name 'web-app*' -printf '%f\n' \
|
||||
| sed -E 's/^web-app[_-]?//' \
|
||||
find $(ROLES_DIR) -maxdepth 1 -type d -name '*' -printf '%f\n' \
|
||||
| sed -E 's/.*-//' \
|
||||
| grep -E -x '[a-z0-9]+' \
|
||||
| sort -u \
|
||||
| paste -sd, - \
|
||||
)
|
||||
|
||||
|
@ -80,7 +80,7 @@ def main():
|
||||
sys.exit(1)
|
||||
config_data["group_id"] = gid_number
|
||||
result["defaults_applications"][application_id] = config_data
|
||||
users_meta_file = role_dir / "meta" / "users.yml"
|
||||
users_meta_file = role_dir / "users" / "main.yml"
|
||||
transformed_users = {}
|
||||
if users_meta_file.exists():
|
||||
users_meta = load_yaml_file(users_meta_file)
|
||||
|
@ -18,6 +18,7 @@ class TestGenerateDefaultApplicationsUsers(unittest.TestCase):
|
||||
(self.role / "vars").mkdir(parents=True)
|
||||
(self.role / "config").mkdir(parents=True)
|
||||
(self.role / "meta").mkdir(parents=True)
|
||||
(self.role / "users").mkdir(parents=True)
|
||||
|
||||
# Write application_id and configuration
|
||||
(self.role / "vars" / "main.yml").write_text("application_id: app_with_users\n")
|
||||
@ -30,7 +31,7 @@ class TestGenerateDefaultApplicationsUsers(unittest.TestCase):
|
||||
'bob': {'uid': 2002, 'gid': 2002}
|
||||
}
|
||||
}
|
||||
with (self.role / "meta" / "users.yml").open('w', encoding='utf-8') as f:
|
||||
with (self.role / "users" / "main.yml").open('w', encoding='utf-8') as f:
|
||||
yaml.dump(users_meta, f)
|
||||
|
||||
# Output file path
|
||||
|
Loading…
x
Reference in New Issue
Block a user