Git Product home page Git Product logo

Comments (5)

djdanielsson avatar djdanielsson commented on August 26, 2024

I am looking into a fix, I tried changing the defaults to tower_ah_url: "https://{{ tower_ah_nodes[0] | default('localhost') }}" but it didn't seem to work. It works when I put it in my main vars but I thought you might want to avoid that. What do you think?

from aap_utilities.

Tompage1994 avatar Tompage1994 commented on August 26, 2024

The obvious solution is to just set the value of tower_ah_url in your playbook. I do, however, like the idea of setting it to be related to tower_ah_nodes, although that might not work in all circumstances (e.g. if you defined some host specific vars under tower_ah_hosts - bit of a hack but can be done).

I'm not entirely sure why your example does not work. When i put together a simple debugging playbook it does seem to:

---
- hosts: localhost
  vars:
    tower_ah_nodes:
      - ahnode.example.com
  tasks:
    - debug:
        msg: "https://{{ tower_ah_nodes[0] | default('localhost') }}"

results in

TASK [debug] *************************************************************************************
ok: [localhost] => {
    "msg": "https://ah-node-dc1.example.com"

and setting tower_ah_nodes: [] (as per default) you get

ok: [localhost] => {
    "msg": "https://localhost"
}

So seemingly working?

from aap_utilities.

djdanielsson avatar djdanielsson commented on August 26, 2024

I might not have been clear, it does work when I have it in my vars file with everything else, it does not however work when I modified the defaults file to that instead of directly setting it to localhost. I will test again to confirm that it does not work in defaults or if it was some oversight on my part that caused it to not work when I first tried it.

from aap_utilities.

djdanielsson avatar djdanielsson commented on August 26, 2024

Ok I figured it out I was being stupid and modified the wrong defaults/main.yml which is why it didn't work for me. But you said you didn't like this as a full on fix?

from aap_utilities.

Tompage1994 avatar Tompage1994 commented on August 26, 2024

No, I'm happy for the default to be set as tower_ah_nodes[0]. For instances where tower_ah_nodes is set as something where this just wouldnt work, the user can just use their own value for tower_ah_url

from aap_utilities.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.