kitchen-ansible icon indicating copy to clipboard operation
kitchen-ansible copied to clipboard

Unable to run community commands

Open ahrenstein opened this issue 3 years ago • 3 comments

With the following configuration for the test suite

suites:
  - name: create
    provisioner:
      require_ansible_repo: true
      require_ansible_source: false
      ansible_sudo: true
      playbook: tests/playbooks/repo-role.yml
      hosts: kitchen
      roles_path: .
      requirements_path: requirements.yml
      ansible_inventory: tests/inventory
      host_vars_path: tests/host_vars/create
    verifier:
      inspec_tests:
        - tests/smoke/repo-role/create

I am unable to run the following task

- name: Manage DNS record
  community.general.cloudflare_dns:
    zone: "{{ cf_zone_name }}"
    type: "CNAME"
    record: "{{ tunnel_name }}"
    value: "{{ tunnel_id[0] }}.cfargotunnel.com"
    proxied: yes
    ttl: 1 # 1 = automatic
    api_token: "{{ cf_api_token }}"
    state: present
  when: tunnel_id != []

due to this error

 ERROR! couldn't resolve module/action 'community.general.cloudflare_dns'. This often indicates a misspelling, missing collection, or incorrect module path.
       
       The error appears to be in '/tmp/kitchen/roles/tasks/dns.yml': line 1, column 3, but may
       be elsewhere in the file depending on the exact syntax problem.
       
       The offending line appears to be:
       
       - name: Manage DNS record

How can I get Kitchen to run the role with community.general installed on the target?

ahrenstein avatar Jun 17 '22 20:06 ahrenstein

Additionally the requirements_path: requirements.yml` file contains the following:

---

# Used for Cloudflare DNS
collections:
- name: community.general

ahrenstein avatar Jun 17 '22 20:06 ahrenstein

Additionally the requirements_path: requirements.yml` file contains the following:

---

# Used for Cloudflare DNS
collections:
- name: community.general

try:

requirements_collection_path: requirements.yml
additional_copy_path: requirements.yml

IronforgeV avatar Dec 31 '22 20:12 IronforgeV