From 189a3e3f18acfd0599f7d315727c7c5e9565c1c6 Mon Sep 17 00:00:00 2001 From: Jeffrey Cutter Date: Mon, 18 Dec 2023 15:44:18 +0800 Subject: [PATCH] commit pre-commit and ansible-lint fixes excluding syntax_highlighting_demo.yml --- .github/workflows/image-build.yaml | 12 ++++++------ .vscode/settings.json | 2 +- Dockerfile | 2 +- README.md | 2 +- .../extensions/molecule/default/create.yml | 4 ++-- .../extensions/molecule/default/destroy.yml | 2 +- .../sample_namespace/sample_collection/galaxy.yml | 7 +++---- .../sample_collection/roles/backup_file/README.md | 2 +- .../roles/backup_file/molecule/default/create.yml | 4 ++-- .../roles/backup_file/molecule/default/destroy.yml | 2 +- .../roles/backup_file/tests/inventory | 1 - devfile.yaml | 2 +- playbooks/install_oc.yml | 6 +++--- 13 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml index 46a6bdb..34a8c40 100644 --- a/.github/workflows/image-build.yaml +++ b/.github/workflows/image-build.yaml @@ -24,14 +24,14 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: "Docker quay.io Login" uses: docker/login-action@v2 with: registry: quay.io username: ${{ secrets.QUAY_USERNAME }} password: ${{ secrets.QUAY_PASSWORD }} - + - name: Check Commit Message id: check_message run: | @@ -42,7 +42,7 @@ jobs: else echo "update_devfile=true" >> $GITHUB_OUTPUT fi - + - name: Build and push Docker image; Update image in devfile if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' run: | @@ -56,7 +56,7 @@ jobs: fi echo "Tag: $tag" image_id=$(docker build -q -t "quay.io/devspaces/ansible-creator-ee:${tag}" .) - + short_sha=$(echo $image_id | cut -c8-12) echo "Short SHA: $short_sha" docker tag quay.io/devspaces/ansible-creator-ee:${tag} quay.io/devspaces/ansible-creator-ee:${tag}-${short_sha} @@ -66,13 +66,13 @@ jobs: docker pull quay.io/devspaces/ansible-creator-ee:${tag} digest=$(docker inspect --format='{{index .RepoDigests 0}}' quay.io/devspaces/ansible-creator-ee:${tag}) sed -r -i devfile.yaml -e "s|(image: .+devspaces/ansible-creator-ee.+)|image: ${digest}|g" - + - name: Set up Git if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' run: | git config --global user.email "vsvydenk@redhat.com" git config --global user.name "Valerii Svydenko" - + - name: Commit and Push Changes if: steps.check_message.outputs.update_devfile == 'true' || github.actor == 'devstudio-release' run: | diff --git a/.vscode/settings.json b/.vscode/settings.json index 1b0cb43..cf97fcf 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,4 +12,4 @@ "ansible.validation.enabled": true, "ansible.validation.lint.enabled": true, "ansible.validation.lint.path": "/usr/local/bin/ansible-lint" -} \ No newline at end of file +} diff --git a/Dockerfile b/Dockerfile index 4312693..1873722 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN \ curl -LO https://dl.k8s.io/release/`curl -LS https://dl.k8s.io/release/stable.txt`/bin/linux/amd64/kubectl && \ chmod +x ./kubectl && \ mv ./kubectl /usr/local/bin && \ - kubectl version --client + kubectl version --client ## helm RUN \ diff --git a/README.md b/README.md index cbb0ad9..153d037 100644 --- a/README.md +++ b/README.md @@ -69,4 +69,4 @@ To reset your test pod back to a fresh instance you can run `molecule destroy` a Contributions to this repository are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue with [Red Hat](https://issues.redhat.com/projects/CRW/issues). ## Code of Conduct -We ask all of our community members and contributors to adhere to the [Ansible code of conduct](http://docs.ansible.com/ansible/latest/community/code_of_conduct.html). If you have questions or need assistance, please reach out to our community team at [codeofconduct@ansible.com](mailto:codeofconduct@ansible.com) +We ask all of our community members and contributors to adhere to the [Ansible code of conduct](http://docs.ansible.com/ansible/latest/community/code_of_conduct.html). If you have questions or need assistance, please reach out to our community team at [codeofconduct@ansible.com](mailto:codeofconduct@ansible.com) diff --git a/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/create.yml b/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/create.yml index b6f7d9c..05333ed 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/create.yml +++ b/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/create.yml @@ -19,7 +19,7 @@ ansible.builtin.debug: var: server - - name: Store container information # noqa: no-handler + - name: Store container information # noqa: no-handler when: server.changed | default(false) | bool block: @@ -27,7 +27,7 @@ ansible.builtin.set_fact: instance_conf_dict: { 'instance': "{{ item.result.status.containerStatuses[0].name }}", - } + } with_items: "{{ server.results }}" register: instance_config_dict diff --git a/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/destroy.yml b/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/destroy.yml index 92431e7..2445e2a 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/destroy.yml +++ b/collections/ansible_collections/sample_namespace/sample_collection/extensions/molecule/default/destroy.yml @@ -22,7 +22,7 @@ ansible.builtin.set_fact: instance_conf: {} - - name: Dump instance config + - name: Dump instance config # noqa: no-handler ansible.builtin.copy: content: | # Molecule managed diff --git a/collections/ansible_collections/sample_namespace/sample_collection/galaxy.yml b/collections/ansible_collections/sample_namespace/sample_collection/galaxy.yml index ad092a7..26e51bc 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/galaxy.yml +++ b/collections/ansible_collections/sample_namespace/sample_collection/galaxy.yml @@ -16,7 +16,7 @@ readme: README.md # A list of the collection's content authors. Can be just the name or in the format 'Full Name (url) # @nicks:irc/im.site#channel' authors: -- your name + - your name ### OPTIONAL but strongly recommended @@ -26,7 +26,7 @@ description: your collection description # Either a single license or a list of licenses for content inside of a collection. Ansible Galaxy currently only # accepts L(SPDX,https://spdx.org/licenses/) licenses. This key is mutually exclusive with 'license_file' license: -- GPL-2.0-or-later + - GPL-2.0-or-later # The path to the license file for the collection. This path is relative to the root of the collection. This key is # mutually exclusive with 'license' @@ -34,7 +34,7 @@ license_file: '' # A list of tags you want to associate with the collection for indexing/searching. A tag name has the same character # requirements as 'namespace' and 'name' -tags: [] +tags: [linux, infrastructure] # Collections that this collection requires to be installed for it to be usable. The key of the dict is the # collection label 'namespace.name'. The value is a version range @@ -66,4 +66,3 @@ build_ignore: [] # 'omit_default_directives' is a boolean that controls whether the default directives are used. Mutually exclusive # with 'build_ignore' # manifest: null - diff --git a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/README.md b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/README.md index 694f4dd..9254715 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/README.md +++ b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/README.md @@ -1,7 +1,7 @@ backup_file ========= -Sample role to demonstrate running molecule inside of OpenShift Dev Spaces. Molecule is configured to leverage the downstream API to create containers in the user's devspace namespace. This role does not require elevated permissions or modifications to OpenShift. +Sample role to demonstrate running molecule inside of OpenShift Dev Spaces. Molecule is configured to leverage the downstream API to create containers in the user's devspace namespace. This role does not require elevated permissions or modifications to OpenShift. Requirements ------------ diff --git a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/create.yml b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/create.yml index b6f7d9c..05333ed 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/create.yml +++ b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/create.yml @@ -19,7 +19,7 @@ ansible.builtin.debug: var: server - - name: Store container information # noqa: no-handler + - name: Store container information # noqa: no-handler when: server.changed | default(false) | bool block: @@ -27,7 +27,7 @@ ansible.builtin.set_fact: instance_conf_dict: { 'instance': "{{ item.result.status.containerStatuses[0].name }}", - } + } with_items: "{{ server.results }}" register: instance_config_dict diff --git a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/destroy.yml b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/destroy.yml index 92431e7..2445e2a 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/destroy.yml +++ b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/molecule/default/destroy.yml @@ -22,7 +22,7 @@ ansible.builtin.set_fact: instance_conf: {} - - name: Dump instance config + - name: Dump instance config # noqa: no-handler ansible.builtin.copy: content: | # Molecule managed diff --git a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/tests/inventory b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/tests/inventory index c411267..aa5c63e 100644 --- a/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/tests/inventory +++ b/collections/ansible_collections/sample_namespace/sample_collection/roles/backup_file/tests/inventory @@ -1,2 +1 @@ ubi8-int - diff --git a/devfile.yaml b/devfile.yaml index 506d466..e0b1b3d 100644 --- a/devfile.yaml +++ b/devfile.yaml @@ -91,7 +91,7 @@ commands: if [ ! -d "$HOME/.cache/ansible-navigator" ]; then mkdir -p "$HOME/.cache/ansible-navigator" fi - cp /usr/local/lib/python3.11/site-packages/ansible_navigator/data/catalog_collections.py $HOME/.cache/ansible-navigator + cp /usr/local/lib/python3.11/site-packages/ansible_navigator/data/catalog_collections.py $HOME/.cache/ansible-navigator ansible-navigator --ee false workingDir: ${PROJECTS_ROOT}/ansible-devspaces-demo component: tooling-container diff --git a/playbooks/install_oc.yml b/playbooks/install_oc.yml index d93354d..1cce46b 100644 --- a/playbooks/install_oc.yml +++ b/playbooks/install_oc.yml @@ -19,13 +19,13 @@ path: "{{ molecule_user_home_dir }}/bin" state: directory mode: 0770 - + - name: Download oc binary from OCP downloads svc endpoint ansible.builtin.get_url: url: http://downloads.openshift-console.svc.cluster.local/amd64/linux/oc dest: "{{ molecule_user_home_dir }}/bin/oc" mode: '0770' - + - name: Add another bin dir to system-wide $PATH. ansible.builtin.lineinfile: path: "{{ molecule_user_home_dir }}/.bashrc" @@ -36,4 +36,4 @@ ansible.builtin.pip: name: "{{ molecule_pip_dependencies }}" state: present - when: molecule_pip_dependencies is defined \ No newline at end of file + when: molecule_pip_dependencies is defined