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 deploying the playbook #630

Closed
gcpmendez opened this issue Feb 6, 2023 · 2 comments
Closed

Error deploying the playbook #630

gcpmendez opened this issue Feb 6, 2023 · 2 comments
Labels

Comments

@gcpmendez
Copy link

gcpmendez commented Feb 6, 2023

Description

TASK [devsec.hardening.os_hardening : Set ownership of root user home directory(s) to 0700] ************************************
fatal: [NextCloud_test_node]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 4\n\nThe error appears to be in '/root/.ansible/collections/ansible_collections/devsec/hardening/roles/os_hardening/tasks/user_accounts.yml': line 52, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set ownership of root user home directory(s) to 0700\n  ^ here\n"}

Reproduction steps

$ ansible-galaxy collection install devsec.hardening
$ cat /etc/ansible/endurecimiento.yml 
---
- name: Aplicar endurecimiento de seguridad
  hosts: NextCloud_test_node
  collections:
    - devsec.hardening
  tasks:
    - name: Ejecutar endurecimiento de seguridad del SO
      include_role:
        name: os_hardening
    - name: Ejecutar endurecimiento de seguridad del ssh
      include_role:
        name: ssh_hardening

Current Behavior

I obtained the error:

TASK [devsec.hardening.os_hardening : Set ownership of root user home directory(s) to 0700] ************************************
fatal: [NextCloud_test_node]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: list object has no element 4\n\nThe error appears to be in '/root/.ansible/collections/ansible_collections/devsec/hardening/roles/os_hardening/tasks/user_accounts.yml': line 52, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Set ownership of root user home directory(s) to 0700\n  ^ here\n"}

Expected Behavior

No fails

OS / Environment

Ubuntu-20.04

Ansible Version

$ ansible --version
ansible [core 2.13.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]
  jinja version = 3.0.3
  libyaml = True

Collection Version

$ ansible-galaxy collection list devsec.hardening

# /root/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
devsec.hardening 8.6.0  
@gcpmendez gcpmendez added the bug label Feb 6, 2023
@schurzi
Copy link
Contributor

schurzi commented Feb 7, 2023

Thank you for this report, this is likely related to a very recent change in our collection. To debug this further it would be very helpful if you cold post the first few lines of the file /etc/passwd of your server. Please be mindful that this file could contain possibly confidential information so please review the contents before posting! If you are not comfortable with posting the contents I want to ask if you have a user(s) with the UID 0?

@rndmh3ro
Copy link
Member

Closing as per lack of responser! Feel free to reopen if the issue persists.

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

No branches or pull requests

3 participants