title |
category |
layout |
prism_languages |
updated |
Ansible modules |
Ansible |
2017/sheet |
|
2017-10-03 |
Aptitude
Packages
- apt: pkg=nodejs state=present
state=present # absent | latest
update_cache=yes
force=no
Deb files
- apt: deb=https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
Repositories
- apt_repository: repo='deb https://... raring main'
state=present
Repository keys
- apt_key: id=AC40B2F7 url="http://..."
state=present
file
File
- file:
state=directory # file | link | hard | touch | absent
path=/etc/dir
owner=bin
group=wheel
mode=0644
recurse=yes # mkdir -p
force=yes # ln -nfs
Copy
- copy:
src=/app/config/nginx.conf
dest=/etc/nginx/nginx.conf
Templates
- template:
src=config/redis.j2
dest=/etc/redis.conf
git
- git: repo=git://github.com/
dest=/srv/checkout
version=master
depth=10
bare=yes
user
- user: state=present name=git
system=yes
shell=/bin/sh
groups=admin
comment="Git Version Control"
service
- service: name=nginx state=started [enabled=yes]
shell
- shell: apt-get install nginx -y
- script: /x/y/script.sh
local_action
- name: do something locally
local_action: shell echo hello
debug
- debug:
msg: "Hello {{ var }}"