techbeck03.git_controls.git_files (1.0.7) — module

Add, remove and commit files to existing git repo

| "added in version" 1.0.0 of techbeck03.git_controls"

Authors: Brandon Beck (@techBeck03)

Install collection

Install with ansible-galaxy collection install techbeck03.git_controls:==1.0.7


Add to requirements.yml

  collections:
    - name: techbeck03.git_controls
      version: 1.0.7

Description

This module adds, removes and commits files to a git repo clone to the specified working directory

Inputs

    
org:
    description:
    - Name of the GitHub organization (or user account)
    - If not set, the value of the C(GIT_ORG) environment variable is used.
    required: true
    type: str

repo:
    description:
    - Name of the GitHub repository
    - If not set, the value of the C(GIT_REPO) environment variable is used.
    required: true
    type: str

branch:
    default: master
    description:
    - Name of the GitHub repository branch
    required: true
    type: str

add_files:
    description:
    - A list of filenames to be added to the specified git repo working directory
    - Filenames can be relative to the working directory
    elements: str
    required: false
    type: list

git_token:
    description:
    - Git token used for authentication
    - Required if I(git_username=None)
    - If not set, the value of the C(GIT_TOKEN) environment variable is used.
    required: false
    type: str

working_dir:
    description: Path to the working directory for git clone
    required: true
    type: str

git_password:
    description:
    - Password used for Github authorization
    - Required if I(git_token=None)
    - If not set, the value of the C(GIT_PASSWORD) environment variable is used.
    required: false
    type: str

git_username:
    description:
    - Username used for Github authorization
    - Required if I(git_token=None)
    - If not set, the value of the C(GIT_USERNAME) environment variable is used.
    required: false
    type: str

remove_files:
    description:
    - A list of filenames to be removed from the specified git repo working directory
    - Filenames can be relative to the working directory
    elements: str
    required: false
    type: list

commit_string:
    description:
    - The commit string used for git repo commit
    required: true
    type: str

Outputs

added_files:
  description: A list of filenames added with latest commit
  elements: str
  returned: changed
  sample: '[/tmp/myrepo]'
  type: list
removed_files:
  description: A list of filenames removed with latest commit
  elements: str
  returned: changed
  sample: '[/tmp/myrepo]'
  type: list