N
N
Nikolay Baranenko2022-02-08 10:39:45
Continuous Integration
Nikolay Baranenko, 2022-02-08 10:39:45

What is the best way to get out of the naming situation in ansible deploy?

For deployment, there is ansible playbook.yml

- name: Start Docker container api
      docker_container:
        name: "api_{{ target_host }}"
        image: "{{ api_artifact }}"
        recreate: true
        volumes:
          - "{{ app_dir }}:/app/storage"
        exposed_ports:
          - 5000
        env:
          HTTP_PROXY: "{{ HTTP_PROXY }}"
          HTTPS_PROXY: "{{ HTTPS_PROXY }}"
          LDAP_HOST: "{{ LDAP_HOST }}"
        networks:
          - name: "{{ project_name }}_network"
            aliases:
              - backend


ENV style - write in capital letters,
ansible vars style - write in small letters

I understand that write
LDAP_HOST: "{{ ldap_host }}"
and is free, BUT I wrote it this way because you can just copy and add lines from ENV and avoid unnecessary
errors in accordance

Is it possible to somehow get out of this situation in order to make the variables in small letters and send them to ENV in large letters?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question