From 76c9a0d6d4835e028321aee33cef25d3d9765856 Mon Sep 17 00:00:00 2001 From: Tim Flink Date: Mon, 17 Mar 2014 21:21:04 +0000 Subject: [PATCH] adding ansible config to ansible-server role --- roles/ansible-server/tasks/main.yml | 4 + roles/ansible-server/templates/ansible.cfg.j2 | 91 +++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 roles/ansible-server/templates/ansible.cfg.j2 diff --git a/roles/ansible-server/tasks/main.yml b/roles/ansible-server/tasks/main.yml index ab7f2d9951..75fd264c65 100644 --- a/roles/ansible-server/tasks/main.yml +++ b/roles/ansible-server/tasks/main.yml @@ -7,9 +7,13 @@ with_items: - ansible - git + - httpd tags: - packages +- name: generate default ansible config + template: src=ansible.cfg.j2 dest=/etc/ansible/ansible.cfg owner=root group=root mode=0644 + # # TODO: # cgit? diff --git a/roles/ansible-server/templates/ansible.cfg.j2 b/roles/ansible-server/templates/ansible.cfg.j2 new file mode 100644 index 0000000000..a1fb0cd6e9 --- /dev/null +++ b/roles/ansible-server/templates/ansible.cfg.j2 @@ -0,0 +1,91 @@ +# config file for ansible -- http://ansible.github.com +# nearly all parameters can be overridden in ansible-playbook or with command line flags +# ansible will read ~/.ansible.cfg or /etc/ansible/ansible.cfg, whichever it finds first + +[defaults] + +# location of inventory file, eliminates need to specify -i + +hostfile = {{ ansible_base }}/inventory/inventory + +# location of ansible library, eliminates need to specify --module-path + +library = {{ ansible_base }}/library:/usr/share/ansible + +# location of ansible log file +log_path = /var/log/ansible/ansible.log + +# default module name used in /usr/bin/ansible when -m is not specified + +module_name = command + +# home directory where temp files are stored on remote systems. Should +# almost always contain $HOME or be a directory writeable by all users + +remote_tmp = $HOME/.ansible/tmp + +# the default pattern for ansible-playbooks ("hosts:") + +pattern = * + +# the default number of forks (parallelism) to be used. Usually you +# can crank this up. + +forks=25 + +# the timeout used by various connection types. Usually this corresponds +# to an SSH timeout + +timeout=10 + +# when using --poll or "poll:" in an ansible playbook, and not specifying +# an explicit poll interval, use this interval + +poll_interval=15 + +# when specifying --sudo to /usr/bin/ansible or "sudo:" in a playbook, +# and not specifying "--sudo-user" or "sudo_user" respectively, sudo +# to this user account + +sudo_user=root + +# connection to use when -c is not specified + +#transport=paramiko + +# remote SSH port to be used when --port or "port:" or an equivalent inventory +# variable is not specified. + +remote_port=22 + +# if set, always run /usr/bin/ansible commands as this user, and assume this value +# if "user:" is not set in a playbook. If not set, use the current Unix user +# as the default + +remote_user=root + +# if set, always use this private key file for authentication, same as if passing +# --private-key-file to ansible or ansible-playbook + +#private_key_file=/path/to/file + + +# additional plugin paths for non-core plugins + +action_plugins = {{ ansible_base }}/action_plugins:/usr/lib/python2.6/site-packages/ansible/runner/action_plugins +lookup_plugins = {{ ansible_base }}/lookup_plugins:/usr/lib/python2.6/site-packages/ansible/runner/lookup_plugins +callback_plugins = {{ ansible_base }}/callback_plugins:/usr/lib/python2.6/site-packages/ansible/callback_plugins + +host_key_checking=False + +[paramiko_connection] + +# nothing to configure yet + +[ssh_connection] + +# if uncommented, sets the ansible ssh arguments to the following. Leaving off ControlPersist +# will result in poor performance, so use transport=paramiko on older platforms rather than +# removing it + +ssh_args=-o PasswordAuthentication=no -o ControlMaster=auto -o ControlPath=/tmp/ansible-ssh-%h-%p-%r