/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Administration/Server/Provisioning/ansible/modules.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2017-04-03 02:45:17 UTC
  • Revision ID: csa@suren.me-20170403024517-dwzj0z0k1cmhxm7u
Restructuring, OpenShift, Ansible, Git

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Modules
 
2
=======
 
3
    command: <name> <args> creates/removes="fileglob"                                           - just run the specified executable unless the specified fileglob already exists / does not exist
 
4
    shell: <sh-code>                                                                            - execute shell command
 
5
 
 
6
    local_action: command <cmd> <args>                                                          - perform command on a control (ansible) system
 
7
    wait_for: host="" port="" state=started/stoped                                              - wait until service is ready
 
8
 
 
9
 - Distribute files & configurations
 
10
    copy:                                                                                       - local-2-remote or remote-2-remote
 
11
    synchronize:                                                                                - rsync (if delegated will syncrhonise from the delegated host, otherwise from control)
 
12
    template: src="tmpl.j2" dest="/path/to/file"                                                - copy from template
 
13
    
 
14
 - Package management
 
15
    yum name="<package>" state=present/absent/latest                                            - install (and update if the state=latest)
 
16
    
 
17
 - System management
 
18
    service: name=firewalld state=started enabled=yes                                           - SystemD services
 
19
    firewalld: service="glusterfs" state="enabled" permanent="true" immediate="true"            - FirewallD rules
 
20
 
 
21
 - Manage configurations
 
22
    lineinfile: dest="/etc/hosts" line="{{ip}} {{host}}" regexp="{{host}}" state="present"      - Ensure the line is in the file, regexp is used to remove lines from file 'when' state is 'absent'
 
23
    blockinfile:
 
24
    replace:                                                                                    - Regexp-replace
 
25
 
 
26
 
 
27
 
 
28
 - Mounts, Files, and Directories
 
29
    mount: name="/mnt/path" src="/dev/sda1" fstype="xfs" opts="defaults" state="mounted"        - adds to fstab
 
30
    filesystem: fstype="xfs" resizefs="yes" dev="/dev/sda1"                                     - does not reformat if file system already exists
 
31
    file: path='/path/to/file' state='directory' owner='root' group='root' mode='0755'          - ensures directory is existing
 
32
 
 
33