diff --git a/ansible_deployer/command_line.py b/ansible_deployer/command_line.py index da38b568..5d14f83d 100644 --- a/ansible_deployer/command_line.py +++ b/ansible_deployer/command_line.py @@ -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) @@ -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)) @@ -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)