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 msg when using kubernetes inventory #658

Open
smutel opened this issue Nov 13, 2023 · 0 comments
Open

Error msg when using kubernetes inventory #658

smutel opened this issue Nov 13, 2023 · 0 comments

Comments

@smutel
Copy link

smutel commented Nov 13, 2023

SUMMARY

When I am using kubernetes inventory, I received this error message:

[WARNING]:  * Failed to parse /tmp/test/inventories/test/k8s.yml with ansible_collections.kubernetes.core.plugins.inventory.k8s plugin: 'AnsibleSequence' object has no attribute 'get'
ISSUE TYPE
  • Bug Report
COMPONENT NAME

ansible_collections.kubernetes.core.plugins.inventory.k8s

ANSIBLE VERSION
ansible [core 2.15.6]
  config file = /tmp/test/ansible.cfg
  configured module search path = ['/home/test/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/test/.local/share/virtualenvs/test-hxkKlP5o/lib/python3.10/site-packages/ansible
  ansible collection location = /home/test/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/test/.local/share/virtualenvs/test-hxkKlP5o/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/home/test/.local/share/virtualenvs/test-hxkKlP5o/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
kubernetes.core 2.4.0
CONFIGURATION
CONFIG_FILE() = /tmp/test/ansible.cfg
DEFAULT_BECOME(/tmp/test/ansible.cfg) = True
DEFAULT_FORKS(/tmp/test/ansible.cfg) = 30
DEFAULT_GATHERING(/tmp/test/ansible.cfg) = explicit
DISPLAY_SKIPPED_HOSTS(env: ANSIBLE_DISPLAY_SKIPPED_HOSTS) = True
EDITOR(env: EDITOR) = vim
HOST_KEY_CHECKING(/tmp/test/ansible.cfg) = False
INVENTORY_ENABLED(/tmp/test/ansible.cfg) = ['kubernetes.core.k8s']
OS / ENVIRONMENT
  • Ubuntu 22.04.3 LTS
  • Ansible inventory (inventories/test/k8s.yml):
- name: Test                                                                                        
  plugin: kubernetes.core.k8s                                                                       
  connections:                                                                                      
    - name: Test                                                                                    
      kubeconfig: /home/test/.kube/default                                                        
      namespaces:                                                                                   
        - default
  • Ansible.cfg:
[defaults]
host_key_checking = False
forks = 30
gathering = explicit

[inventory]
enable_plugins = kubernetes.core.k8s

[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o ConnectionAttempts=100 -o UserKnownHostsFile=/dev/null

[privilege_escalation]
become = yes
STEPS TO REPRODUCE

ansible-inventory --list -i inventories/test

EXPECTED RESULTS

Inventory displayed

ACTUAL RESULTS
[WARNING]:  * Failed to parse /tmp/test/inventories/test/k8s.yml with ansible_collections.kubernetes.core.plugins.inventory.k8s plugin: 'AnsibleSequence' object has no attribute 'get'
[WARNING]: Unable to parse /tmp/test/inventories/test/k8s.yml as an inventory source
[WARNING]: Unable to parse /tmp/test/inventories/test as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
    "_meta": {
        "hostvars": {}
    },
    "all": {
        "children": [
            "ungrouped"
        ]
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants