packer ansible provisioner host_vars groups_vars

358 views
Skip to first unread message

Matthieu Dolci

unread,
Jan 24, 2017, 6:39:44 PM1/24/17
to Packer
Hello,

I am having issues with packer and the remote ansible provisioner. Packer doesnt seems to take the variables in the different groups_vars and in host_vars. Here is  the layout of the all project:

ansible
     |------Infrastructure.Analytics # submodule
                                           |-------groups_vars
                                                          |-----all
                                                          |-----db
                                           |-------host_vars
                                                          |-----packer-postgresql
                                           |-------postgresql.yml
packer.json


the provisioner looks like this:

      "type": "ansible",
      "extra_arguments": ["-b","--become-method=sudo","--vault-password-file=~/.vault_pass.txt"],
      "playbook_file": "ansible/Infrastructure.Analytics/postgresql.yml",
      "groups": ["all","db","postgresql","development","tag_Application_Service_PostgreSQL","packer-postgresql"],
      "host_alias": "packer-postgresql"
    },

How can i make packer use those variables?

Cheers

Matthieu

unread,
Jan 24, 2017, 9:38:31 PM1/24/17
to Packer
Nevermind i had a typo!!!

Tony

unread,
Apr 5, 2018, 10:42:36 AM4/5/18
to Packer
Hi, could you please share your full json file. I have the same problem and unable to resolv it :(

среда, 25 января 2017 г., 1:39:44 UTC+2 пользователь Matthieu написал:

Matthieu

unread,
Apr 5, 2018, 5:16:28 PM4/5/18
to Packer
Hi Tony,

Unfortunately i do work for the company i was working for at the time of those messages and therefore don't have the json file

Tony

unread,
Apr 6, 2018, 12:08:58 PM4/6/18
to Packer
Thanks for answer. But you have had success in using host_vars and group_vars in ansible provisioner at packer script?

пятница, 6 апреля 2018 г., 0:16:28 UTC+3 пользователь Matthieu написал:
Reply all
Reply to author
Forward
0 new messages