cans.directory-make

directory-make

==============

This role makes sure certain directories exist and have the correct permissions.

Each directory is described as follows:

  • group: The name of the group that the directory belongs to (default: dirmake_group)
  • mode: The permissions for the directory (default: 0700)
  • owner: The user that owns the directory (default: dirmake_user)
  • path: The directory's location that you want to check (required, no default)

Requirements


This role does not have any specific requirements.

Role Variables


All variables in this role start with the prefix dirmake_.

  • dirmake_directories: A list of directories to check, with details as mentioned above (default: [])
  • dirmake_group: The default group for the directories (default: none, system will decide)
  • dirmake_mode: The default permissions for the directories (default: 0700)
  • dirmake_owner: The default owner of the directories (default: remote_user)

Dependencies


This role does not depend on any other roles.

Example Playbook


Here is an example of how to use this role (with variables specified):

- hosts: servers
  vars:
    dirmake_directories:
      - path: "/home/user/some/path"
        owner: "alice"
        mode: 0600
      - path: "/home/user/some/other/path"
      - path: "/home/user/yet/another/directory"
        group: "bob"
  roles:
    - role: cans.directory-make


- hosts: servers
  vars_files:
    - vars/part1.yml   # contains directory_list_1
    - vars/part2.yml   # contains directory_list_2
  roles:
    - role: cans.directory-make
      dirmake_directories: "{{ directory_list_1 + directory_list_2 }}"

License


GPLv2

Author Information


Copyright © 2017, Nicolas CANIART.

Informazioni sul progetto

Simple Ansible role to ensure some diretories exists and have expected permissions

Installa
ansible-galaxy install cans.directory-make
Licenza
gpl-2.0
Download
162
Proprietario