Skip to content

Instantly share code, notes, and snippets.

@aminvakil
Last active September 19, 2022 07:28
Show Gist options
  • Save aminvakil/b1734554a9446ed4840c9b2d31e1bde2 to your computer and use it in GitHub Desktop.
Save aminvakil/b1734554a9446ed4840c9b2d31e1bde2 to your computer and use it in GitHub Desktop.
Schema bug with user module
#!/bin/bash
ansible-galaxy role init lint_test
cd lint_test/
ansible-lint .
#####
# Current errors are ok and we don't have anything to do with them
#####
echo "- name: Create user
user:
name: lintuser" >> tasks/main.yml
ansible-lint .
#####
# schema: {'name': 'create user', 'user': {'name': 'lintuser'}} is not valid under any of the given schemas (schema[tasks])
# Why is it not valid?
#####
sed -i 's/user\:/ansible.builtin.user\:/g' tasks/main.yml
ansible-lint .
#####
# Error has been gone now, using fqcns are not mandatory AFAIK and the only problem I have seen so far is with user module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment