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

Error while running the comamnd #24

Closed
contactjegan opened this issue Jan 18, 2021 · 2 comments
Closed

Error while running the comamnd #24

contactjegan opened this issue Jan 18, 2021 · 2 comments
Assignees
Labels
Debugging Debugging Cases

Comments

@contactjegan
Copy link

ERROR! the role 'CIS-Ubuntu-20.04-Ansible' was not found in /opt/hardening/roles:/root/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/opt/hardening

The error appears to be in '/opt/hardening/run.yaml': line 7, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

roles:
- { role: "CIS-Ubuntu-20.04-Ansible" }
^ here
This one looks easy to fix. It seems that there is a value started
with a quote, and the YAML parser is expecting to see the line ended
with the same kind of quote. For instance:

when: "ok" in result.stdout

Could be written as:

when: '"ok" in result.stdout'

Or equivalently:

when: "'ok' in result.stdout"

@contactjegan contactjegan added the Debugging Debugging Cases label Jan 18, 2021
@alivx
Copy link
Owner

alivx commented Jan 18, 2021

Try the below:

cd /srv/;clone  https://github.com/alivx/CIS-Ubuntu-20.04-Ansible.git

put your run.yaml under /srv/

Then run your playbook.

Note:
Content of run.yaml should be like this

---
- hosts: 127.0.0.1
    connection: local
    become: yes
    remote_user: root
    gather_facts: no
    roles:
        - { role: "CIS-Ubuntu-20.04-Ansible" }

@contactjegan
Copy link
Author

Hi alvix, thanks for your support. the issue has been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Debugging Debugging Cases
Projects
None yet
Development

No branches or pull requests

2 participants