ansible / terraform-provider-ansible

community terraform provider for ansible
https://registry.terraform.io/providers/ansible/ansible/latest
GNU General Public License v3.0
201 stars 45 forks source link

EXTRA VARS #133

Open 4erdenko opened 3 months ago

4erdenko commented 3 months ago

Hi! Im using this:

  extra_vars = {
    gitlab_url                = var.gitlab_url
    gitlab_runner_token       = var.gitlab_runner_vm_token
    gitlab_runner_description = var.gitlab_runner_vm_description
    gitlab_runner_tags        = var.gitlab_runner_vm_tags
    ansible_user              = var.ansible_user
    ANSIBLE_CONFIG            = "${path.module}/ansible/ansible.cfg"
    ANSIBLE_ROLES_PATH        = "${path.module}/ansible/roles"
  }

And ANSIBLE_CONFIG \ ANSIBLE_ROLES_PATH vars are doesnt work. It keeping using playbooks/roles and ignoring config file. What im doing wrong?

4erdenko commented 2 months ago
│ Error: ansible-playbook [core 2.14.5]
│   config file = None
│   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
│   ansible python module location = /usr/lib/python3.11/site-packages/ansible
│   ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
│   executable location = /usr/bin/ansible-playbook
│   python version = 3.11.8 (main, Feb 19 2024, 22:58:08) [GCC 12.2.1 20220924] (/usr/bin/python3)
│   jinja version = 3.1.4
│   libyaml = True

Im already tried:ansible_config_file = "/etc/ansible/ansible.cfg"