├── LICENSE ├── MANIFEST.in ├── README.md ├── ansibleart ├── __init__.py ├── bin │ └── ansible-art └── data │ ├── ansible-art_playbook.yml.j2 │ └── ansible.cfg └── setup.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Tatsunori Saito 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | recursive-include ansibleart/data * 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ansible-art 2 | ansible apply role tool: ansible-art is a simple tool to apply role of ansible. 3 | 4 | ## abstract 5 | To apply role of ansible, we need to write playbook for each role in conventional. By using ansible-art, we can apply role to machines directly, without writing playbook by ourself. ansible-art will create playbook instead of us. 6 | 7 | ## install 8 | First, install ansible-art with `pip` command. 9 | ``` 10 | pip install ansible-art 11 | ``` 12 | Second, edit config file to set the dir of roles installed in advance. 13 | ``` 14 | ansible-art config 15 | ``` 16 | The place which we need to change; 17 | ``` 18 | roles_path = 19 | ``` 20 | Please specify the dir of roles as ``. 21 | 22 | ## usage 23 | ``` 24 | *** usage *** 25 | ansible-art [-h] [-V] 26 | ansible-art role list 27 | ansible-art role params 28 | ansible-art config 29 | ansible-art apply [-p ] [-g ] [-a ] 30 | ``` 31 | 32 | - `ansible-art [-h] [-V]` 33 | 34 | Using option `[-h]`, show help message and exit. Using option `[-V]`, show version and exit. 35 | 36 | - `ansbile-art role list` 37 | 38 | Show roles in the dir specified in config file. 39 | 40 | - `ansible-art role params ` 41 | 42 | Show parameters defined in defaults/main.yml of specified role. 43 | 44 | - `ansible-art config` 45 | 46 | Edit config file. 47 | 48 | - `ansible-art apply [-p ] [-g ] [-a ]` 49 | 50 | Apply role to machines. In ``, specify role wanted to apply. In ``, specify inventory file path to use. In ``, specify the directory including host_vars files or group_vars files. If `` is not specified, `host_vars` dir or `group_vars` dir searched as host_vars dir or group_vars dir. If `host_vars` dir or `group_vars` dir is not exist, no host_vars files or group_vars files are used. In ``, we can specify some arguments of the command "ansible-playbook". Since ansible-art apply role to "all" group by default, if necessary, specify target group, ip or hostname by using `-l` option of the command "ansible-playbook". 51 | -------------------------------------------------------------------------------- /ansibleart/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbrfkr/ansible-art/d1dba0068743e3f9988d393b54a21584e6546642/ansibleart/__init__.py -------------------------------------------------------------------------------- /ansibleart/bin/ansible-art: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | #coding: utf-8 3 | 4 | ### import module 5 | import sys 6 | import os 7 | import argparse 8 | import ConfigParser 9 | import shutil 10 | from jinja2 import Environment, FileSystemLoader 11 | import subprocess 12 | import re 13 | import ansibleart 14 | 15 | ### constant 16 | VERSION = "0.3.2" 17 | HOME_DIR = os.environ['HOME'] 18 | CONFIG_PATH = HOME_DIR + "/.ansible-art.cfg" 19 | WORK_DIR = HOME_DIR + "/.ansible-art" 20 | CURRENT_DIR = os.getcwd() 21 | PLAYBOOK_FILE = "ansible-art_playbook.yml" 22 | INVENTORY_FILE = "hosts" 23 | 24 | # help message 25 | HELP_ROOT = 'A simple tool to apply role of ansible' 26 | HELP_VERSION = 'show version and exit' 27 | HELP_ROLE = 'operate with roles used by ansible-art' 28 | HELP_ROLE_LIST = 'show roles in the dir specified in config file' 29 | HELP_ROLE_PARAMS = 'show parameters defined in defaults/main.yml of specified role' 30 | HELP_ROLE_PARAMS_ROLE = 'the role whose parameters are wanted to show' 31 | HELP_CONFIG = 'edit config file' 32 | HELP_APPLY = 'apply a role to machines' 33 | HELP_APPLY_ROLE = 'the role wanted to apply' 34 | HELP_APPLY_INVENTORY = 'an inventory file path' 35 | HELP_APPLY_PARAMS = 'specify the directory including host_vars files. if this parameter is not specified, ansible-art search "host_vars" dir as the directory including host_vars files. If "host_vars" dir is not found, no host_vars files are used' 36 | HELP_APPLY_GROUP_PARAMS = 'specify the directory including group_vars files. if this parameter is not specified, ansible-art search "group_vars" dir as the directory including group_vars files. If "group_vars" dir is not found, no group_vars files are used' 37 | HELP_APPLY_ARGS = 'specify some arguments. ansible-art delivers the arguments specified here to "ansible-playbook" command. since ansible-art apply role to \"all\" group by default, if necessary, specify target group, ip or hostname by using \"-l\" option of the command \"ansible-playbook\"' 38 | 39 | ### utility function 40 | def check_config(): 41 | return os.path.exists(CONFIG_PATH) 42 | 43 | def create_config(): 44 | config_path = os.path.dirname(sys.modules["ansibleart"].__file__) + "/data/ansible.cfg" 45 | shutil.copy(config_path, CONFIG_PATH) 46 | 47 | def check_defaults_section(config): 48 | return config.has_section("defaults") 49 | 50 | def check_abs_path(str): 51 | return re.match('^/.*',str) 52 | 53 | def check_option_exist(config): 54 | return config.has_option("defaults", "roles_path") 55 | 56 | def check_roles_option(config): 57 | return check_abs_path(config.get("defaults", "roles_path")) 58 | 59 | def get_roles_dir(): 60 | config = ConfigParser.SafeConfigParser() 61 | try: 62 | config.read(CONFIG_PATH) 63 | except ConfigParser.MissingSectionHeaderError as e: 64 | print "ERROR: " + e.message 65 | sys.exit(1) 66 | except ConfigParser.ParsingError as e: 67 | print "ERROR: " + e.message 68 | sys.exit(1) 69 | if check_defaults_section(config): 70 | if check_option_exist(config): 71 | if check_roles_option(config): 72 | return config.get("defaults", "roles_path") 73 | else: 74 | print "ERROR: roles_path option dosen't have absolute path!" 75 | sys.exit(1) 76 | else: 77 | print "ERROR: \"roles_path\" option is not found in config file!" 78 | sys.exit(1) 79 | else: 80 | print "ERROR: config file dosen't have [defaults] section!" 81 | sys.exit(1) 82 | os.remove(CONFIG_PATH + ".bk") 83 | 84 | def check_role(role): 85 | roles_dir = get_roles_dir() 86 | return os.path.exists(roles_dir + "/" + role + "/tasks/main.yml") 87 | 88 | def get_roles(): 89 | roles_dir = get_roles_dir() 90 | if os.path.isdir(roles_dir): 91 | pre_roles = os.listdir(roles_dir) 92 | roles = [] 93 | for pre_role in pre_roles: 94 | if check_role(pre_role): 95 | roles.append(pre_role) 96 | return roles 97 | else: 98 | print "ERROR: the directory of roles \"" + roles_dir + "\" is not found" 99 | sys.exit(1) 100 | 101 | def check_role_exist(role): 102 | roles = get_roles() 103 | return role in roles 104 | 105 | def check_role_params(role,roles_dir): 106 | return os.path.exists(roles_dir + "/" + role + "/defaults/main.yml") 107 | 108 | def create_work_dir(): 109 | if os.path.exists(WORK_DIR): 110 | print "ERROR: working directory \"" + WORK_DIR + "\" already exists" 111 | sys.exit(1) 112 | os.mkdir(WORK_DIR) 113 | 114 | def copy_params(params): 115 | if params is not None: 116 | if os.path.isdir(params): 117 | shutil.copytree(params, WORK_DIR + "/host_vars" ) 118 | else: 119 | print "ERROR: params dir \"" + params + "\" is not found" 120 | sys.exit(1) 121 | else: 122 | if os.path.isdir(CURRENT_DIR + "/host_vars"): 123 | shutil.copytree(CURRENT_DIR + "/host_vars", WORK_DIR + "/host_vars") 124 | 125 | def copy_group_params(group_params): 126 | if group_params is not None: 127 | if os.path.isdir(group_params): 128 | shutil.copytree(group_params, WORK_DIR + "/group_vars" ) 129 | else: 130 | print "ERROR: group params dir \"" + group_params + "\" is not found" 131 | sys.exit(1) 132 | else: 133 | if os.path.isdir(CURRENT_DIR + "/group_vars"): 134 | shutil.copytree(CURRENT_DIR + "/group_vars", WORK_DIR + "/group_vars") 135 | 136 | def create_playbook(role): 137 | package_path = os.path.dirname(sys.modules["ansibleart"].__file__) 138 | env = Environment(loader=FileSystemLoader(package_path + "/data", encoding='utf8')) 139 | template = env.get_template("ansible-art_playbook.yml.j2") 140 | ansible_playbook = template.render({'role': role}) 141 | ansible_playbook_file = open(WORK_DIR + "/" + PLAYBOOK_FILE,"w") 142 | ansible_playbook_file.write(ansible_playbook.encode("utf-8")) 143 | ansible_playbook_file.close() 144 | 145 | ### core function 146 | def print_roles(): 147 | roles = get_roles() 148 | for role in roles: 149 | print role 150 | 151 | def print_role_params(role): 152 | if check_role_exist(role): 153 | roles_dir = get_roles_dir() 154 | if check_role_params(role, roles_dir): 155 | defaults = open(roles_dir + "/" + role + "/defaults/main.yml",'r') 156 | print defaults.read() 157 | defaults.close() 158 | else: 159 | print "ERROR: role \"" + role + "\" is not found" 160 | sys.exit(1) 161 | 162 | def edit_config(): 163 | shutil.copy(CONFIG_PATH, CONFIG_PATH + ".bk") 164 | cmd = "vi " + CONFIG_PATH 165 | subprocess.Popen([ cmd ], shell=True).wait() 166 | config = ConfigParser.SafeConfigParser() 167 | try: 168 | config.read(CONFIG_PATH) 169 | except ConfigParser.MissingSectionHeaderError as e: 170 | print "ERROR: " + e.message 171 | print "recover config file..." 172 | shutil.move(CONFIG_PATH + ".bk", CONFIG_PATH) 173 | sys.exit(1) 174 | except ConfigParser.ParsingError as e: 175 | print "ERROR: " + e.message 176 | print "recover config file..." 177 | shutil.move(CONFIG_PATH + ".bk", CONFIG_PATH) 178 | sys.exit(1) 179 | if check_defaults_section(config): 180 | if check_option_exist(config): 181 | if not check_roles_option(config): 182 | print "ERROR: roles_path option dosen't have absolute path!" 183 | print "recover config file..." 184 | shutil.move(CONFIG_PATH + ".bk", CONFIG_PATH) 185 | sys.exit(1) 186 | else: 187 | print "ERROR: \"roles_path\" option is not found in config file!" 188 | print "recover config file..." 189 | shutil.move(CONFIG_PATH + ".bk", CONFIG_PATH) 190 | sys.exit(1) 191 | else: 192 | print "ERROR: config file dosen't have [defaults] section!" 193 | print "recover config file..." 194 | shutil.move(CONFIG_PATH + ".bk", CONFIG_PATH) 195 | sys.exit(1) 196 | 197 | def apply_role(role, inventory, params, group_params, args): 198 | create_work_dir() 199 | try: 200 | shutil.copy(CONFIG_PATH, WORK_DIR + "/ansible.cfg") 201 | if check_role_exist(role): 202 | if os.path.isfile(inventory): 203 | shutil.copy(inventory, WORK_DIR + "/" + INVENTORY_FILE) 204 | copy_params(params) 205 | copy_group_params(group_params) 206 | create_playbook(role) 207 | if args is None: 208 | cmd = "ansible-playbook" + " -i " + INVENTORY_FILE + " " + PLAYBOOK_FILE 209 | else: 210 | cmd = "ansible-playbook" + " -i " + INVENTORY_FILE + " " + PLAYBOOK_FILE + " " + args 211 | subprocess.Popen([ cmd ],cwd=(WORK_DIR), shell=True).wait() 212 | else: 213 | print "ERROR: inventory \"" + inventory + "\" is not found" 214 | sys.exit(1) 215 | else: 216 | print "ERROR: role \"" + role + "\" is not found" 217 | sys.exit(1) 218 | finally: 219 | shutil.rmtree(WORK_DIR) 220 | 221 | ### definition of parser 222 | parser = argparse.ArgumentParser(description=HELP_ROOT) 223 | parser.add_argument('-V','--version', action='version', version='%(prog)s.' + VERSION, help=HELP_VERSION) 224 | 225 | subparsers = parser.add_subparsers(title='subcommands',description='valid subcommands',dest='root') 226 | parser_role = subparsers.add_parser('role',description=HELP_ROLE, help=HELP_ROLE) 227 | parser_config = subparsers.add_parser('config',description=HELP_CONFIG, help=HELP_CONFIG) 228 | parser_apply = subparsers.add_parser('apply',description=HELP_APPLY, help=HELP_APPLY) 229 | parser_apply.add_argument('ROLE',help=HELP_APPLY_ROLE) 230 | parser_apply.add_argument('INVENTORY',help=HELP_APPLY_INVENTORY) 231 | parser_apply.add_argument('-p', '--params', metavar='DIR',help=HELP_APPLY_PARAMS) 232 | parser_apply.add_argument('-g', '--group-params', metavar='DIR',help=HELP_APPLY_GROUP_PARAMS) 233 | parser_apply.add_argument('-a', '--args',metavar='ARGS',help=HELP_APPLY_ARGS) 234 | 235 | subparsers_role = parser_role.add_subparsers(title='subcommands',description='valid subcommands', dest='role') 236 | parser_role_list = subparsers_role.add_parser('list',description=HELP_ROLE_LIST, help=HELP_ROLE_LIST) 237 | parser_role_params = subparsers_role.add_parser('params',description=HELP_ROLE_PARAMS, help=HELP_ROLE_PARAMS) 238 | parser_role_params.add_argument('ROLE', help=HELP_ROLE_PARAMS_ROLE) 239 | 240 | ### main 241 | # check and create config file 242 | if not check_config(): 243 | create_config() 244 | 245 | # add space to -a option argument, 246 | # this procedure is to prevent that arguments parser interpretate 247 | # -a option argument is for ansible-art command, not ansible-playbook one. 248 | for i in range(0,len(sys.argv)-1): 249 | if sys.argv[i] == "-a": 250 | if i != len(sys.argv) - 1: 251 | sys.argv[i+1] = sys.argv[i+1] + " " 252 | 253 | args = parser.parse_args() 254 | 255 | if args.root == "role": 256 | if args.role == "list": 257 | print_roles() 258 | if args.role == "params": 259 | print_role_params(args.ROLE) 260 | elif args.root == "config": 261 | edit_config() 262 | elif args.root == "apply": 263 | apply_role(args.ROLE, args.INVENTORY, args.params, args.group_params, args.args) 264 | else: 265 | print "ERROR: inner error" 266 | sys.exit(1) 267 | 268 | -------------------------------------------------------------------------------- /ansibleart/data/ansible-art_playbook.yml.j2: -------------------------------------------------------------------------------- 1 | --- 2 | - name: apply role *** {{ role }} *** 3 | hosts: all 4 | roles: 5 | - {{ role }} 6 | 7 | -------------------------------------------------------------------------------- /ansibleart/data/ansible.cfg: -------------------------------------------------------------------------------- 1 | # config file for ansible -- http://ansible.com/ 2 | # ============================================== 3 | 4 | # nearly all parameters can be overridden in ansible-playbook 5 | # or with command line flags. ansible will read ANSIBLE_CONFIG, 6 | # ansible.cfg in the current working directory, .ansible.cfg in 7 | # the home directory or /etc/ansible/ansible.cfg, whichever it 8 | # finds first 9 | 10 | [defaults] 11 | 12 | # some basic default values... 13 | 14 | inventory = /etc/ansible/hosts 15 | #library = /usr/share/my_modules/ 16 | remote_tmp = $HOME/.ansible/tmp 17 | pattern = * 18 | forks = 5 19 | poll_interval = 15 20 | sudo_user = root 21 | #ask_sudo_pass = True 22 | #ask_pass = True 23 | transport = smart 24 | #remote_port = 22 25 | module_lang = C 26 | 27 | # plays will gather facts by default, which contain information about 28 | # the remote system. 29 | # 30 | # smart - gather by default, but don't regather if already gathered 31 | # implicit - gather by default, turn off with gather_facts: False 32 | # explicit - do not gather by default, must say gather_facts: True 33 | gathering = implicit 34 | 35 | # additional paths to search for roles in, colon separated 36 | roles_path = /etc/ansible/roles 37 | 38 | # uncomment this to disable SSH key host checking 39 | host_key_checking = False 40 | 41 | # change this for alternative sudo implementations 42 | sudo_exe = sudo 43 | 44 | # what flags to pass to sudo 45 | #sudo_flags = -H 46 | 47 | # SSH timeout 48 | timeout = 10 49 | 50 | # default user to use for playbooks if user is not specified 51 | # (/usr/bin/ansible will use current user as default) 52 | #remote_user = root 53 | 54 | # logging is off by default unless this path is defined 55 | # if so defined, consider logrotate 56 | #log_path = /var/log/ansible.log 57 | 58 | # default module name for /usr/bin/ansible 59 | #module_name = command 60 | 61 | # use this shell for commands executed under sudo 62 | # you may need to change this to bin/bash in rare instances 63 | # if sudo is constrained 64 | #executable = /bin/sh 65 | 66 | # if inventory variables overlap, does the higher precedence one win 67 | # or are hash values merged together? The default is 'replace' but 68 | # this can also be set to 'merge'. 69 | #hash_behaviour = replace 70 | 71 | # list any Jinja2 extensions to enable here: 72 | #jinja2_extensions = jinja2.ext.do,jinja2.ext.i18n 73 | 74 | # if set, always use this private key file for authentication, same as 75 | # if passing --private-key to ansible or ansible-playbook 76 | #private_key_file = /path/to/file 77 | 78 | # format of string {{ ansible_managed }} available within Jinja2 79 | # templates indicates to users editing templates files will be replaced. 80 | # replacing {file}, {host} and {uid} and strftime codes with proper values. 81 | ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host} 82 | 83 | # by default, ansible-playbook will display "Skipping [host]" if it determines a task 84 | # should not be run on a host. Set this to "False" if you don't want to see these "Skipping" 85 | # messages. NOTE: the task header will still be shown regardless of whether or not the 86 | # task is skipped. 87 | #display_skipped_hosts = True 88 | 89 | # by default (as of 1.3), Ansible will raise errors when attempting to dereference 90 | # Jinja2 variables that are not set in templates or action lines. Uncomment this line 91 | # to revert the behavior to pre-1.3. 92 | #error_on_undefined_vars = False 93 | 94 | # by default (as of 1.6), Ansible may display warnings based on the configuration of the 95 | # system running ansible itself. This may include warnings about 3rd party packages or 96 | # other conditions that should be resolved if possible. 97 | # to disable these warnings, set the following value to False: 98 | #system_warnings = True 99 | 100 | # by default (as of 1.4), Ansible may display deprecation warnings for language 101 | # features that should no longer be used and will be removed in future versions. 102 | # to disable these warnings, set the following value to False: 103 | #deprecation_warnings = True 104 | 105 | # (as of 1.8), Ansible can optionally warn when usage of the shell and 106 | # command module appear to be simplified by using a default Ansible module 107 | # instead. These warnings can be silenced by adjusting the following 108 | # setting or adding warn=yes or warn=no to the end of the command line 109 | # parameter string. This will for example suggest using the git module 110 | # instead of shelling out to the git command. 111 | # command_warnings = False 112 | 113 | 114 | # set plugin path directories here, separate with colons 115 | action_plugins = /usr/share/ansible_plugins/action_plugins 116 | callback_plugins = /usr/share/ansible_plugins/callback_plugins 117 | connection_plugins = /usr/share/ansible_plugins/connection_plugins 118 | lookup_plugins = /usr/share/ansible_plugins/lookup_plugins 119 | vars_plugins = /usr/share/ansible_plugins/vars_plugins 120 | filter_plugins = /usr/share/ansible_plugins/filter_plugins 121 | 122 | # by default callbacks are not loaded for /bin/ansible, enable this if you 123 | # want, for example, a notification or logging callback to also apply to 124 | # /bin/ansible runs 125 | #bin_ansible_callbacks = False 126 | 127 | 128 | # don't like cows? that's unfortunate. 129 | # set to 1 if you don't want cowsay support or export ANSIBLE_NOCOWS=1 130 | #nocows = 1 131 | 132 | # don't like colors either? 133 | # set to 1 if you don't want colors, or export ANSIBLE_NOCOLOR=1 134 | #nocolor = 1 135 | 136 | # the CA certificate path used for validating SSL certs. This path 137 | # should exist on the controlling node, not the target nodes 138 | # common locations: 139 | # RHEL/CentOS: /etc/pki/tls/certs/ca-bundle.crt 140 | # Fedora : /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem 141 | # Ubuntu : /usr/share/ca-certificates/cacert.org/cacert.org.crt 142 | #ca_file_path = 143 | 144 | # the http user-agent string to use when fetching urls. Some web server 145 | # operators block the default urllib user agent as it is frequently used 146 | # by malicious attacks/scripts, so we set it to something unique to 147 | # avoid issues. 148 | #http_user_agent = ansible-agent 149 | 150 | # if set to a persistent type (not 'memory', for example 'redis') fact values 151 | # from previous runs in Ansible will be stored. This may be useful when 152 | # wanting to use, for example, IP information from one group of servers 153 | # without having to talk to them in the same playbook run to get their 154 | # current IP information. 155 | fact_caching = memory 156 | 157 | 158 | # retry files 159 | #retry_files_enabled = False 160 | #retry_files_save_path = ~/.ansible-retry 161 | 162 | [privilege_escalation] 163 | #become=True 164 | #become_method=sudo 165 | #become_user=root 166 | #become_ask_pass=False 167 | 168 | [paramiko_connection] 169 | 170 | # uncomment this line to cause the paramiko connection plugin to not record new host 171 | # keys encountered. Increases performance on new host additions. Setting works independently of the 172 | # host key checking setting above. 173 | #record_host_keys=False 174 | 175 | # by default, Ansible requests a pseudo-terminal for commands executed under sudo. Uncomment this 176 | # line to disable this behaviour. 177 | #pty=False 178 | 179 | [ssh_connection] 180 | 181 | # ssh arguments to use 182 | # Leaving off ControlPersist will result in poor performance, so use 183 | # paramiko on older platforms rather than removing it 184 | #ssh_args = -o ControlMaster=auto -o ControlPersist=60s 185 | 186 | # The path to use for the ControlPath sockets. This defaults to 187 | # "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with 188 | # very long hostnames or very long path names (caused by long user names or 189 | # deeply nested home directories) this can exceed the character limit on 190 | # file socket names (108 characters for most platforms). In that case, you 191 | # may wish to shorten the string below. 192 | # 193 | # Example: 194 | # control_path = %(directory)s/%%h-%%r 195 | #control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r 196 | 197 | # Enabling pipelining reduces the number of SSH operations required to 198 | # execute a module on the remote server. This can result in a significant 199 | # performance improvement when enabled, however when using "sudo:" you must 200 | # first disable 'requiretty' in /etc/sudoers 201 | # 202 | # By default, this option is disabled to preserve compatibility with 203 | # sudoers configurations that have requiretty (the default on many distros). 204 | # 205 | #pipelining = False 206 | 207 | # if True, make ansible use scp if the connection type is ssh 208 | # (default is sftp) 209 | #scp_if_ssh = True 210 | 211 | [accelerate] 212 | accelerate_port = 5099 213 | accelerate_timeout = 30 214 | accelerate_connect_timeout = 5.0 215 | 216 | # The daemon timeout is measured in minutes. This time is measured 217 | # from the last activity to the accelerate daemon. 218 | accelerate_daemon_timeout = 30 219 | 220 | # If set to yes, accelerate_multi_key will allow multiple 221 | # private keys to be uploaded to it, though each user must 222 | # have access to the system via SSH to add a new key. The default 223 | # is "no". 224 | #accelerate_multi_key = yes 225 | 226 | [selinux] 227 | # file systems that require special treatment when dealing with security context 228 | # the default behaviour that copies the existing context or uses the user default 229 | # needs to be changed to use the file system dependant context. 230 | #special_context_filesystems=nfs,vboxsf,fuse 231 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | from setuptools import setup 5 | from setuptools import find_packages 6 | 7 | 8 | def main(): 9 | description = 'A simple tool to apply role of ansible' 10 | 11 | setup( 12 | name='ansible-art', 13 | version='0.3.2', 14 | author='Tatsunori Saito', 15 | author_email='bbrfkr@gmail.com', 16 | url='https://github.com/bbrfkr/ansible-art', 17 | description=description, 18 | long_description=description, 19 | zip_safe=False, 20 | include_package_data=True, 21 | packages=['ansibleart'], 22 | package_dir={'ansibleart': 'ansibleart'}, 23 | package_data={'ansibleart': ['data/*']}, 24 | install_requires=[], 25 | scripts=['ansibleart/bin/ansible-art'], 26 | tests_require=[], 27 | setup_requires=[], 28 | ) 29 | 30 | 31 | if __name__ == '__main__': 32 | main() 33 | --------------------------------------------------------------------------------