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'
- saltext.github.states.github.__virtual__()[source]¶
Only load if the github module is available in __salt__
- saltext.github.states.github.present(name, profile='github', **kwargs)[source]¶
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
- saltext.github.states.github.absent(name, profile='github', **kwargs)[source]¶
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
- saltext.github.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)[source]¶
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.
- saltext.github.states.github.team_absent(name, profile='github', **kwargs)[source]¶
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.
- saltext.github.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)[source]¶
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.
- saltext.github.states.github.repo_absent(name, profile='github', **kwargs)[source]¶
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.
- saltext.github.states.github.ruleset_absent(name, ruleset_type, profile='github', owner=None, repo_name=None, org_name=None, **kwargs)[source]¶
Ensure a ruleset is absent.
Example:
ensure rulset test is absent in github: github.ruleset_absent: - name: 'test' - ruleset_type: 'repo' - owner: test - repo_name: test_repo
The following parameters are required:
- name
name of the ruleset.
- ruleset_type
type of ruleset (‘org’ or ‘repo’)
- saltext.github.states.github.ruleset_present(name, ruleset_type, profile='github', owner=None, repo_name=None, org_name=None, ruleset_params=None, **kwargs)[source]¶
Ensure a ruleset is present.
Example:
ensure rulset test is present in github: github.ruleset_present: - name: test - ruleset_type: repo - owner: test - repo_name: test_repo - ruleset_params: target: branch enforcement: disabled
The following parameters are required:
- name
name of the ruleset.
- ruleset_type
type of ruleset (‘org’ or ‘repo’)
- ruleset_params
parameters to set the ruleset rules. i.e {‘enforcement’: ‘disabled’}