Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the ansible lint check workflow file #75

Closed

Conversation

Sakethanne
Copy link
Contributor

fix(workflow): updated the ansible lint check workflow file

@Sakethanne Sakethanne requested a review from a team as a code owner October 22, 2024 00:00
# Install/Update Ansible and Ansible-lint
- name: Install Ansible
run: |
python3 -m pip install ansible ansible-lint

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 0: pipCommand not pinned by hash
Click Remediation section below to solve this issue
Copy link
Member

@glimchb glimchb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not

              - name: run-ansible-lint
                uses: ansible/[email protected]

first ?

see https://ansible.readthedocs.io/projects/lint/installing/#installing-ansible-lint-as-a-github-action

and warning

A new release of ansible-lint is available: 24.5.0 → 24.9.2

@Sakethanne
Copy link
Contributor Author

I tried that initially, but it is still unable to recognize the installed collections. with the new script we do not need to specify the version, as it automatically picks up the latest version available

@glimchb
Copy link
Member

glimchb commented Oct 22, 2024

I tried that initially, but it is still unable to recognize the installed collections. with the new script we do not need to specify the version, as it automatically picks up the latest version available

maybe we need to pass argument like

requirements_file: Path to the requirements.yml file to install role and collection dependencies.

@Sakethanne
Copy link
Contributor Author

when I try to install the collections, it says they are already installed

Run ansible-galaxy collection install arista.eos
  ansible-galaxy collection install arista.eos
  ansible-galaxy collection install community.general
  ansible-galaxy collection install f5networks.f5_modules
  ansible-galaxy collection install community.docker
  shell: /usr/bin/bash -e {0}
Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.
Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.
Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.
Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.

@glimchb
Copy link
Member

glimchb commented Oct 22, 2024

when I try to install the collections, it says they are already installed

how you install them ? manually ? or via argument to github action of linter ?

@Sakethanne
Copy link
Contributor Author

I initially added this as a part of the code:

# Install required Ansible collections
      - name: Install Ansible collections
        run: |
          ansible-galaxy collection install arista.eos
          ansible-galaxy collection install community.general
          ansible-galaxy collection install f5networks.f5_modules
          ansible-galaxy collection install community.docker

then removed it, since they are already installed

@glimchb
Copy link
Member

glimchb commented Oct 22, 2024

I initially added this as a part of the code:

# Install required Ansible collections
      - name: Install Ansible collections
        run: |
          ansible-galaxy collection install arista.eos
          ansible-galaxy collection install community.general
          ansible-galaxy collection install f5networks.f5_modules
          ansible-galaxy collection install community.docker

then removed it, since they are already installed

but this https://ansible.readthedocs.io/projects/lint/installing/#installing-ansible-lint-as-a-github-action clearly states

        uses: ansible/ansible-lint@main
        # optional (see below):
        with:
          args: ""
          setup_python: "true"
          working_directory: ""
          requirements_file: ""

I would try new requirements_file argument

@Sakethanne
Copy link
Contributor Author

Let me try the new option and get back with the results of it soon

Sakethanne and others added 11 commits October 21, 2024 17:46
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
Signed-off-by: sakethanne <[email protected]>
@Sakethanne Sakethanne closed this Oct 22, 2024
@Sakethanne Sakethanne deleted the ansible-lint-workflow-fix branch October 22, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants