Advertisement
blackbinary

Untitled

Jan 27th, 2022
987
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ---
  2. - hosts: localhost
  3.   gather_facts: yes
  4.   vars:
  5.     wanted_int: "21999"
  6.     wanted_replace: "\"port\": {{ wanted_int }} "
  7.     foo:
  8.       name: mcap-svc1 # provides a server to consul
  9.       id: mcap-svc1
  10.       consul_service_state: present
  11.       token: 39fooooooooooooooooooo
  12.       checks:
  13.         - name: "HTTP on Port 80"
  14.           method: "GET"
  15.           http: "http://localhost:80"
  16.           interval: "5s"
  17.           timeout: "1s"
  18.           success_before_passing: 3
  19.           failures_before_critical: 3
  20.       enable_tag_override: false
  21.       port: 80
  22.       tags:
  23.        - foo
  24.         - bar
  25.       connect:
  26.         sidecar_service:
  27.           port: "PLACE_HOLDER"
  28.  
  29.  
  30.   tasks:
  31.   - name: set fact
  32.     set_fact:
  33.       foo2:
  34.         service: "{{ foo | to_json }}"
  35.  
  36.   - name: testing0
  37.     debug:
  38.       msg: "{{ wanted_replace }}"
  39.   - name: testing
  40.     debug:
  41.       msg: "{{foo2 | replace('\"port\": \"PLACE_HOLDER\"', wanted_replace ) }}"
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement