automate-tower icon indicating copy to clipboard operation
automate-tower copied to clipboard

RFE: add support to roll out license file

Open pcfe opened this issue 7 years ago • 3 comments

it would be nice if this role was able to roll out a license file.

FWIW, at https://docs.ansible.com/ansible-tower/latest/html/administration/configure_tower_in_tower.html#license I found instructions how to do this via webUI

pcfe avatar Nov 14 '18 10:11 pcfe

note to self, based on a playbook Eric and I used at another customer

    - name: 'Copy tower-license (must contain "eula_accepted": true)'
      copy:
        src: "{{ tower_license }}"
        dest: "{{ base_copy_dir }}/"
    - name: create configuration file /root/.tower_cli.cfg
      copy:
        content: |
          [general]
          host = localhost
          username = {{ tower_username }}
          password = {{ tower_password }}
        dest: "/root/.tower_cli.cfg"
        mode: 0600
    - name: activate tower
      shell: "tower-cli setting modify LICENSE @{{ base_copy_dir }}/{{ tower_license | basename }}"
      when:  tower_license is defined

will need to add;

  • a tower_username: admin default
  • only copy when: tower_license is defined
  • document that user must manually ACK EULA accepting by editing the file (i.e. do not automate that step)

pcfe avatar Nov 14 '18 10:11 pcfe

ah, just occurred to me that this Issue and #4 are mutually exclusive. @ericzolf please pick one and close the other as WONTFIX

pcfe avatar Nov 14 '18 10:11 pcfe

If it helps, we use the URI module to post the license to Tower: https://github.com/vvaldez/ansible-ami-builder/blob/master/roles/ami_config/tasks/profiles/tower/setup.yml#L23

- name: Post Tower license
  uri:
    url: https://{{ inventory_hostname }}/api/v2/config/
    method: POST
    validate_certs: no
    headers:
      Content-Type: "application/json"
      Accept: "application/json"
    force_basic_auth: yes
    user: "{{ tower_username }}"
    password: "{{ tower_password }}"
    body: '{{ lookup("file", tower_license) }}'
    body_format: json

vvaldez avatar Nov 18 '18 01:11 vvaldez