ctorgalson.files

Ansible Role Files

Build Status

This role makes it easier to use Ansible for creating files, folders, and links.

Role Variables

  • files_files (default []): a list of items that use the Ansible File module. The following File module options are not available:

    • access_time
    • access_time_format
    • attributes
    • follow
    • modification_time
    • modification_time_format
    • selevel
    • serole
    • seuser
    • unsafe_writes

    Other parameters from the File module can still be used when creating File tasks directly.

Example Playbook

It’s helpful to include an example showing how to use your role with parameters:

---
- hosts: all
  roles:
    - role: ansible-role-files
      vars:
        files_files:
          # Create a folder.
          - path: "/home/lorem"
            owner: "lorem"
            group: "lorem"
            mode: "u=rwx,go="
            state: directory
          # Create a folder and its parents.
          - path: "/home/lorem/foo/bar"
            owner: "lorem"
            group: "lorem"
            state: directory
            mode: "u=rwx,g=rx,o="
          # Create an empty file.
          - path: "/home/lorem/baz"
            owner: "lorem"
            group: "lorem"
            state: touch
          # Change properties of an existing file.
          - path: "/home/lorem/.bashrc"
            owner: "lorem"
            group: "lorem"
            mode: "u=rw,go=r"
            state: file
          # Delete a file, folder, or link.
          - path: "/home/lorem/DELETE"
            state: absent
          # Create a symbolic link.
          - src: "/home/lorem/foo/bar"
            dest: "/home/lorem/foobar"
            owner: "lorem"
            group: "lorem"
            state: link
          # Force-create a symbolic link.
          - src: "/home/lorem/foo/bar"
            dest: "/home/lorem/fubar-link"
            owner: "lorem"
            group: "lorem"
            state: link
            force: true

License

GPLv3

Informazioni sul progetto

A role to simplify the creation of files, directories, and links.

Installa
ansible-galaxy install ctorgalson.files
Licenza
gpl-3.0
Download
47.1k
Proprietario