Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: add support to roll out license file #5

Open
pcfe opened this issue Nov 14, 2018 · 3 comments
Open

RFE: add support to roll out license file #5

pcfe opened this issue Nov 14, 2018 · 3 comments

Comments

@pcfe
Copy link
Collaborator

pcfe commented Nov 14, 2018

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
Copy link
Collaborator Author

pcfe commented Nov 14, 2018

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
Copy link
Collaborator Author

pcfe commented Nov 14, 2018

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

@vvaldez
Copy link
Contributor

vvaldez commented Nov 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants