mirror of
https://github.com/mmumshad/ansible-playable.git
synced 2025-03-09 23:38:54 +00:00
Move commands and paths to config file
This commit is contained in:
parent
7a503bcf95
commit
fc7aafa5f6
3 changed files with 94 additions and 64 deletions
|
@ -4,6 +4,17 @@
|
|||
|
||||
module.exports = {
|
||||
|
||||
general:{
|
||||
create_file: 'touch "%s"',
|
||||
read_file: 'cat "%s"',
|
||||
remove_file: 'rm -rf "%s"',
|
||||
list_folder_contents: 'ls "%s"',
|
||||
check_dir_exists: '[ -d "%s" ]',
|
||||
check_dir_not_exists: '[ ! -d "%s" ]',
|
||||
archive_folder: 'mkdir -p %s && tar -cvf %s/%s.tar %s && rm -rf %s',
|
||||
list_roles_files_json: 'cd "%s/roles/%s"; python /tmp/dir_tree.py',
|
||||
list_files_json: 'cd "%s"; python /tmp/dir_tree.py'
|
||||
},
|
||||
ansible:{
|
||||
version : 'ansible --version',
|
||||
doc: 'ansible-doc -l',
|
||||
|
@ -11,7 +22,23 @@ module.exports = {
|
|||
export_ansible_library: 'export ANSIBLE_LIBRARY="%s";',
|
||||
export_force_color: 'export ANSIBLE_FORCE_COLOR=%s;',
|
||||
export_host_key_check: 'export ANSIBLE_HOST_KEY_CHECKING=%s;',
|
||||
|
||||
get_inventory_list: 'cd "%s" ; ls --ignore="*.*" -p | grep -v /',
|
||||
get_vars: 'cd "%s"; python %s host_vars --inventory_file="%s" ',
|
||||
get_role_vars: 'cd "%s"; python "%s" role_vars --playbook_path="%s" ',
|
||||
get_playbook_list: 'ls "%s" | grep .yml',
|
||||
create_ansible_project_folder: 'mkdir -p "%s"; mkdir -p "%s"',
|
||||
create_role: 'cd "%s"; ansible-galaxy init "%s"',
|
||||
copy_role: 'cd "%s/roles"; cp -r "%s" "%s"; rm -rf "%s/.git"',
|
||||
delete_role: 'rm -rf "%s/roles/%s"',
|
||||
list_tags: 'cd "%s"; python2.7 /tmp/list_tasks_json.py "%s" -i "%s" --list-hosts --list-tasks-json ',
|
||||
ansible_galaxy_search: 'ansible-galaxy search %s',
|
||||
ansible_galaxy_install: 'ansible-galaxy install %s -p %s',
|
||||
github_search_api_options: {
|
||||
host: 'api.github.com',
|
||||
path: '/search/repositories?q=ansible-role-%s',
|
||||
headers: {'user-agent': 'node.js'}
|
||||
},
|
||||
git_clone_repo: 'git clone "%s"'
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -7,10 +7,21 @@ exports = module.exports = {
|
|||
'scriptEngine' : {
|
||||
'host' : process.env.SCRIPT_ENGINE_HOST || 'localhost',
|
||||
'user' : process.env.SCRIPT_ENGINE_USER || 'root',
|
||||
// This is the default root password for local container set during docker container rebuild
|
||||
'password' : process.env.SCRIPT_ENGINE_PASSWORD || 'P@ssw0rd@123'
|
||||
},
|
||||
|
||||
paths: {
|
||||
ansible_projects: '/opt/ansible-projects'
|
||||
ansible_projects: '/opt/ansible-projects',
|
||||
ansible_projects_arhive: '/archive', // relative to projects folder
|
||||
ansible_custom_api_local: './helpers/AnsibleAPI.py',
|
||||
ansible_custom_api_remote: '/tmp/AnsibleAPI.py',
|
||||
ansible_dir_tree_local: './helpers/dir_tree.py',
|
||||
ansible_dir_tree_remote: '/tmp/dir_tree.py',
|
||||
ansible_list_tasks_json_local: './helpers/list_tasks_json.py',
|
||||
ansible_list_tasks_json_remote: '/tmp/list_tasks_json.py',
|
||||
ansible_project_library: '/library', // relative to project folder
|
||||
ansible_project_roles: '/roles', // relative to project folder
|
||||
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue