Skip to content
New issue

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

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

Already on GitHub? # to your account

No perm check for alt cfg #103

Merged
merged 2 commits into from
Apr 13, 2022
Merged
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
9 changes: 5 additions & 4 deletions ansible_deployer/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ def validate_options(options: dict):

def load_configuration_file(config_path: str):
"""Function responsible for single file loading and validation"""
#TODO: Add verification of owner/group/persmissions
check_cfg_permissions_and_owner(config_path)

if config_path == APP_CONF:
check_cfg_permissions_and_owner(config_path)
config_file = os.path.basename(config_path)
logger.debug("Loading :%s", config_file)

Expand Down Expand Up @@ -251,7 +252,6 @@ def get_config_paths(config_dir):
tasks_cfg = os.path.join(config_dir, config)
elif config.startswith("acl"):
acl_cfg = os.path.join(config_dir, config)
tasks_cfg = os.path.join(config_dir, config)

if len(ymls) > 0 and len(yamls) > 0:
logger.debug("Config files with yml extensions: %s", " ".join(ymls))
Expand Down Expand Up @@ -697,7 +697,8 @@ def get_all_user_groups():
def load_global_configuration(conf_dir):
"""Function responsible for single file loading and validation"""
main_config_file = os.path.join(conf_dir, "ansible-deploy.yaml")
check_cfg_permissions_and_owner(main_config_file)
if conf_dir == APP_CONF:
check_cfg_permissions_and_owner(main_config_file)
with open(main_config_file, "r", encoding="utf8") as config_stream:
try:
config = yaml.safe_load(config_stream)
Expand Down