# salt.states.github

Github User State Module

Added in version 2016.3.0.

This state is used to ensure presence of users in the Organization.

    ensure user test is present in github:
        github.present:
            - name: 'Example TestUser1'
            - email: example@domain.com
            - username: 'gitexample'

salt.states.github.absent(name, profile='github', **kwargs)

  Ensure a github user is absent

      ensure user test is absent in github:
          github.absent:
              - name: 'Example TestUser1'
              - email: example@domain.com
              - username: 'gitexample'

  The following parameters are required:

  name

    Github handle of the user in organization

salt.states.github.present(name, profile='github', **kwargs)

  Ensure a user is present

      ensure user test is present in github:
          github.present:
              - name: 'gitexample'

  The following parameters are required:

  name

    This is the github handle of the user in the organization

salt.states.github.repo_absent(name, profile='github', **kwargs)

  Ensure a repo is absent.

  Example:

      ensure repo test is absent in github:
          github.repo_absent:
              - name: 'test'

  The following parameters are required:

  name

    This is the name of the repository in the organization.

  Added in version 2016.11.0.

salt.states.github.repo_present(name, description=None, homepage=None, private=None, has_issues=None, has_wiki=None, has_downloads=None, auto_init=False, gitignore_template=None, license_template=None, teams=None, profile='github', **kwargs)

  Ensure a repository is present

  name

    This is the name of the repository.

  description

    The description of the repository.

  homepage

    The URL with more information about the repository.

  private

    The visiblity of the repository. Note that private repositories require a paid GitHub account.

  has_issues

    Whether to enable issues for this repository.

  has_wiki

    Whether to enable the wiki for this repository.

  has_downloads

    Whether to enable downloads for this repository.

  auto_init

    Whether to create an initial commit with an empty README.

  gitignore_template

    The desired language or platform for a .gitignore, e.g "Haskell".

  license_template

    The desired LICENSE template to apply, e.g "mit" or "mozilla".

  teams

    The teams for which this repo should belong to, specified as a dict of team name to permission ('pull', 'push' or 'admin').

    Added in version 2017.7.0.

  Example:

      Ensure repo my-repo is present in github:
          github.repo_present:
              - name: 'my-repo'
              - description: 'My very important repository'

  Added in version 2016.11.0.

salt.states.github.team_absent(name, profile='github', **kwargs)

  Ensure a team is absent.

  Example:

      ensure team test is present in github:
          github.team_absent:
              - name: 'test'

  The following parameters are required:

  name

    This is the name of the team in the organization.

  Added in version 2016.11.0.

salt.states.github.team_present(name, description=None, repo_names=None, privacy='secret', permission='pull', members=None, enforce_mfa=False, no_mfa_grace_seconds=0, profile='github', **kwargs)

  Ensure a team is present

  name

    This is the name of the team in the organization.

  description

    The description of the team.

  repo_names

    The names of repositories to add the team to.

  privacy

    The level of privacy for the team, can be 'secret' or 'closed'. Defaults to secret.

  permission

    The default permission for new repositories added to the team, can be 'pull', 'push' or 'admin'. Defaults to pull.

  members

    The members belonging to the team, specified as a dict of member name to optional configuration. Options include 'enforce_mfa_from' and 'mfa_exempt'.

  enforce_mfa

    Whether to enforce MFA requirements on members of the team. If True then all members without mfa_exempt: True configured will be removed from the team. Note that no_mfa_grace_seconds may be set to allow members a grace period.

  no_mfa_grace_seconds

    The number of seconds of grace time that a member will have to enable MFA before being removed from the team. The grace period will begin from enforce_mfa_from on the member configuration, which defaults to 1970/01/01.

  Example:

      Ensure team test is present in github:
          github.team_present:
              - name: 'test'
              - members:
                  user1: {}
                  user2: {}

      Ensure team test_mfa is present in github:
          github.team_present:
              - name: 'test_mfa'
              - members:
                  user1:
                      enforce_mfa_from: 2016/06/15
              - enforce_mfa: True

  Added in version 2016.11.0.