-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add gnu-tar check * F * F * Fix * No fucking linter * F * F * F? * F * F * F * Upload coll * F * Fix ansible version
- Loading branch information
Showing
8 changed files
with
98 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,26 +18,50 @@ env: | |
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
lint: | ||
# lint: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
|
||
# - name: Run ansible-later | ||
# uses: patrickjahns/[email protected] | ||
# with: | ||
# config: .later.yml | ||
|
||
# - name: Run ansible-lint | ||
# uses: reviewdog/action-ansiblelint@v1 | ||
# with: | ||
# reporter: github-pr-check | ||
# fail_on_error: true | ||
|
||
collection: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Run ansible-later | ||
uses: patrickjahns/[email protected] | ||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
config: .later.yml | ||
python-version: "3.x" | ||
cache: pip | ||
|
||
- name: Run ansible-lint | ||
uses: reviewdog/action-ansiblelint@v1 | ||
- name: Install python dependencies | ||
run: python -m pip install -r requirements.txt | ||
|
||
- name: Build collection | ||
run: ansible-galaxy collection build . | ||
|
||
- name: Upload collection | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
reporter: github-pr-check | ||
fail_on_error: true | ||
path: fluencelabs-provider-*.tar.gz | ||
name: collection | ||
if-no-files-found: error | ||
|
||
molecule: | ||
runs-on: ubuntu-latest | ||
|
||
needs: lint | ||
needs: collection | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -65,6 +89,14 @@ jobs: | |
- name: Install python dependencies | ||
run: python -m pip install -r requirements.txt | ||
|
||
- name: Download collection | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: collection | ||
|
||
- name: Install collection | ||
run: ansible-galaxy collection install fluencelabs-provider-*.tar.gz | ||
|
||
- name: Run ${{ matrix.scenario }} scenario | ||
working-directory: extensions | ||
run: molecule test --scenario-name "${{ matrix.scenario }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
requires_ansible: ">=2.16.0" | ||
requires_ansible: ">=2.12.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/python | ||
|
||
from ansible.module_utils.basic import AnsibleModule | ||
import platform | ||
|
||
|
||
def check_tar_type(module): | ||
cmd = ['tar', '--version'] | ||
rc, out, err = module.run_command(cmd, check_rc=False) | ||
|
||
if rc != 0 or ('GNU tar' not in out and 'bsdtar' not in out): | ||
return None, out | ||
if 'GNU tar' in out: | ||
return 'gnu', out | ||
else: | ||
return 'bsd', out | ||
|
||
|
||
def main(): | ||
module = AnsibleModule( | ||
argument_spec={} | ||
) | ||
|
||
tar_type, tar_output = check_tar_type(module) | ||
|
||
if tar_type == 'gnu': | ||
module.exit_json( | ||
changed=False, | ||
msg="GNU tar is installed.", | ||
tar_type=tar_type) | ||
else: | ||
fail_msg = "Non GNU tar is installed." | ||
if platform.system() == 'Darwin': | ||
fail_msg += " You can install GNU tar with 'brew install gnu-tar'." | ||
module.fail_json(msg=fail_msg, tar_output=tar_output) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters