ANSIBLE PROVIDER FOR TERRAFORM | IT HAS ARRIVED! | HOW TO USE

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

Комментарии • 17

  • @stefan3816
    @stefan3816 Год назад

    This will be extremely useful! I love this level of integration, still a few improvements that can be made, sure, but this can be immensely powerful!

  • @kennethkoffi29
    @kennethkoffi29 Год назад +3

    I spent hours trying to get it work. You forgot to mention that collection requires ansible version >=2.13.0
    There's the command that fixed things for me:
    python3 -m pip install --upgrade ansible

  • @90DaysOfDevOps
    @90DaysOfDevOps 2 месяца назад

    What are the thoughts a year on? I have a use case that could use this... Using terraform to deploy my machines and then I already have created playbooks that work independently for application installation.
    So my hosts are already in the inventory.ini that are deployed via Terraform.... I really just want the ability to run terraform apply and the whole process deploys my machine > installs my app I have considered the local_exec
    doesnt look like this really helps me other than sharing variables?

  • @robertgoldstein5819
    @robertgoldstein5819 Год назад +2

    have thought of using depends option on the ansible resource or some other form of delay?

    • @TheSudo
      @TheSudo  Год назад

      I did not attempt that.

    • @robertgoldstein5819
      @robertgoldstein5819 11 месяцев назад

      I tried it the v1.1 that came out, but maybe it's how the company requires so much hand holding (vaulting passwords and 2fa stuff) or something else.. the provider didn't work out property for me. instead I hacked it a bit a use file templates to generate the configuration and files. this seems to work smoother. then I run the playbooks separately and review the results.

  • @dronenb
    @dronenb Год назад +2

    Do you know if there's a way to use a state file that is in Terraform Cloud instead of local?

    • @TheSudo
      @TheSudo  Год назад

      Not with this plugin, no. You would have to use the terraform cloud API to download the state file locally.

    • @dronenb
      @dronenb Год назад +3

      @@TheSudo that’s what I was concluding as well. Regardless, thanks for the video. Im surprised it doesn’t have more views considering it seems to be the only video on RUclips at the moment on the topic.

    • @dronenb
      @dronenb Год назад +9

      @@TheSudo Actually I figured it out. The module uses the command "terraform show -json STATE_FILE" where STATE_FILE is, by default, the terraform.tfstate file. But you can set the state file name in the inventory with state_file: "" and since it's an empty string it's equivalent to running "terraform show -json" with no other arguments, which works with Terraform Cloud.

    • @mase2hot225
      @mase2hot225 Год назад +1

      @@dronenb I'm confused how ansible will be able to access the state file in terraform cloud, as I see nowhere we can set where to look / authenticate?

    • @dronenb
      @dronenb Год назад +3

      @@mase2hot225 the Ansible inventory plugin calls the terraform CLI with the “terraform state” command IIRC and then parses the JSON

  • @bx1803
    @bx1803 Год назад

    yaaaass

  • @KaokaOnchangwa
    @KaokaOnchangwa Год назад

    All the gard work now gone