Giter Club home page Giter Club logo

ansible-role-tower-config's Introduction

Ansible Tower Config

Simple Role to Configure Ansible Tower by Red Hat.

Requirements

ansible-tower-cli

Role Variables

defaults/main.yml

---
tower_config:
  host: "tower.example.com"
  username: "admin"
  password: "toweradmin"
  verify_ssl: false

  setting:
    license:
      company_name: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      contact_email: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      contact_name: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      hostname: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      instance_count: XXXXXX
      license_date: XXXXXXX
      license_key: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      license_type: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      subscription_name: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
      trial: XXXX
      eula_accepted: true

    proxy:
      http_proxy: "http://172.17.0.1:3128"
      https_proxy: "http://172.17.0.1:3128"
      no_proxy: "localhost,127.0.0.0/8"

  organization:
    README:
      name: "README"
      description: "README"
      custom_virtualenv: "/path/to/virtualenv/readme" # Use false, null, '', or unset this variable to remove
      users:
        - name: "infraops"
          password: "infraops"
          email: "[email protected]"
          first_name: "Infrastructure"
          last_name: "Operations"
          superuser: true
          auditor: false
        - name: "netops"
          password: "netops"
          email: "[email protected]"
          first_name: "Network"
          last_name: "Operations"
          superuser: false
          auditor: false
        - name: "devops"
          password: "devops"
          email: "[email protected]"
          first_name: "Developer"
          last_name: "Operations"
          superuser: false
          auditor: false
        - name: "sysops"
          password: "sysops"
          email: "[email protected]"
          first_name: "System"
          last_name: "Operations"
          superuser: false
          auditor: false
        - name: "secops"
          password: "secops"
          email: "[email protected]"
          first_name: "Security"
          last_name: "Operations"
          superuser: false
          auditor: true
      teams:
        - name: "infraops"
          description: "Infrastructure Operations"
          members:
            - name: "netops"
            - name: "devops"
            - name: "sysops"
            - name: "secops"
        - name: "netops"
          description: "Network Operations"
          members:
            - name: "netops"
        - name: "devops"
          description: "Developer Operations"
          members:
            - name: "devops"
        - name: "sysops"
          description: "System Operations"
          members:
            - name: "sysops"
        - name: "secops"
          description: "Security Operations"
          members:
            - name: "secops"
      credentials:
        - name: "empty-scm"
          username: Null
          password: Null
          kind: "scm"
          description: "Empty credential"
        - name: "network-nxos-ssh"
          kind: "ssh"
          description: "Credential for nxos"
          username: vagrant
          password: vagrant
        - name: "network-nxos-net"
          kind: "net"
          description: "Credential for nxos"
          username: vagrant
          password: vagrant
        - name: "system-linux-ssh"
          kind: "ssh"
          description: "Credential for Linux"
          username: vagrant
          password: vagrant
        - name: "system-windows-ssh"
          kind: "ssh"
          description: "Credential for Windows"
          username: vagrant
          password: vagrant
      projects:
        - name: "Dev: netops:ansible-tower-example"
          description: "Dev: netops:ansible-tower-example"
          scm_credential: "empty-scm"
          scm_type: "git"
          scm_branch: "dev"
          scm_update_on_launch: true
          scm_url: "https://github.com/ansible/tower-example"
        - name: "Dev: devops:ansible-tower-example"
          description: "Dev: devops:ansible-tower-example"
          scm_credential: "empty-scm"
          scm_type: "git"
          scm_branch: "dev"
          scm_update_on_launch: true
          scm_url: "https://github.com/ansible/tower-example"
        - name: "Dev: sysops:ansible-tower-example"
          description: "Dev: sysops:ansible-tower-example"
          scm_credential: "empty-scm"
          scm_type: "git"
          scm_branch: "dev"
          scm_update_on_launch: true
          scm_url: "https://github.com/ansible/tower-example"
        - name: "Dev: secops:ansible-tower-example"
          description: "Dev: secops:ansible-tower-example"
          scm_credential: "empty-scm"
          scm_type: "git"
          scm_branch: "dev"
          scm_update_on_launch: true
          scm_url: "https://github.com/ansible/tower-example"
      inventories:
        - name: "infraops"
          description: "infraops"
        - name: "netops"
          description: "netops"
        - name: "sysops"
          description: "sysops"
        - name: "secops"
          description: "secops"
      job_templates:
        - name: "Dev: netops:helloworld"
          description: "Dev: netops:helloworld"
          project: "Dev: netops:ansible-tower-example"
          playbook: "helloworld.yml"
          inventory: "netops"
          forks: 50
          limit: "dev"
          credential: "network-nxos-ssh, network-nxos-net"
        - name: "Dev: devops:helloworld"
          description: "Dev: devops:helloworld"
          project: "Dev: netops:ansible-tower-example"
          playbook: "helloworld.yml"
          inventory: "devops"
          forks: 50
          limit: "dev"
          credential: "system-linux-ssh"
        - name: "Dev: sysops:helloworld"
          description: "Dev: sysops:helloworld"
          project: "Dev: sysops:ansible-tower-example"
          playbook: "helloworld.yml"
          inventory: "sysops"
          forks: 50
          limit: "dev"
          credential: "system-windows-ssh"
        - name: "Dev: secops:helloworld"
          description: "Dev: secops:helloworld"
          project: "Dev: secops:ansible-tower-example"
          playbook: "helloworld.yml"
          inventory: "secops"
          forks: 50
          limit: "dev"
          credential: "system-linux-ssh"
      workflow_templates:
        - name: "Dev: workflow:helloworld"
          description: "Dev: workflow:helloworld"
          schema:
            - job_template: "Dev: netops:helloworld"
              success:
                - job_template: "Dev: sysops:helloworld"
              failure:
                - job_template: "Dev: secops:helloworld"
      permissions:
        - team: "infraops"
          role: "admin"
          target_team: "infraops"
        - team: "netops"
          role: "admin"
          target_team: "netops"
        - team: "sysops"
          role: "admin"
          target_team: "sysops"
        - team: "secops"
          role: "admin"
          target_team: "secops"
        - team: "secops"
          role: "admin"
          credential: "empty-scm"
        - team: "netops"
          role: "use"
          credential: "empty-scm"
        - team: "devops"
          role: "use"
          credential: "empty-scm"
        - team: "sysops"
          role: "use"
          credential: "empty-scm"
        - team: "secops"
          role: "admin"
          credential: "network-nxos-ssh"
        - team: "netops"
          role: "use"
          credential: "network-nxos-ssh"
        - team: "secops"
          role: "admin"
          credential: "network-nxos-net"
        - team: "netops"
          role: "use"
          credential: "network-nxos-net"
        - team: "secops"
          role: "admin"
          credential: "system-linux-ssh"
        - team: "sysops"
          role: "use"
          credential: "system-linux-ssh"
        - team: "devops"
          role: "use"
          credential: "system-linux-ssh"
        - team: "secops"
          role: "admin"
          credential: "system-windows-ssh"
        - team: "sysops"
          role: "use"
          credential: "system-windows-ssh"
        - team: "devops"
          role: "use"
          credential: "system-windows-ssh"
        - team: "netops"
          role: "admin"
          project: "Dev: netops:ansible-tower-example"
        - team: "devops"
          role: "admin"
          project: "Dev: devops:ansible-tower-example"
        - team: "secops"
          role: "admin"
          project: "Dev: secops:ansible-tower-example"
        - team: "sysops"
          role: "admin"
          project: "Dev: sysops:ansible-tower-example"
        - team: "netops"
          role: "admin"
          job_template: "Dev: netops:helloworld"
        - team: "devops"
          role: "admin"
          job_template: "Dev: devops:helloworld"
        - team: "sysops"
          role: "admin"
          job_template: "Dev: sysops:helloworld"
        - team: "secops"
          role: "admin"
          job_template: "Dev: secops:helloworld"
      notifications:
        - name: "webhook-example"
          description: "Webhook notification"
          notification_type: webhook
          url: "https://www.example.com/webhook"

Dependencies

None

Example Playbook

- name: "Configure Ansible Tower by Red Hat"
  hosts: tower
  become: true

  roles:
    - victorock.tower_config

License

GPLv3

Author Information

Victor da Costa

ansible-role-tower-config's People

Contributors

dbv-rl avatar keilr avatar stenh0use avatar victorock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ansible-role-tower-config's Issues

Feature enhancements

We've been using your role to manage our tower config and code deployments to tower.

We've added a few enhancements, some specific to our architecture. Some are pre-release to ansible 2.8 which uses the new tower notification module.

  • Notifications
  • SAML config
  • Organisation instance group assignment
  • Virtual Env assignment
  • +Bug fixes

Would you be open to us creating pull request?

tower_config : config.variables: Combine Configuration Hashes from User and Role

``

[ansible@automata ansible-hetzner]$ ansible-playbook -b -i hosts tower_config.yml

PLAY [Configure Ansible Tower by Red Hat] ************************************************************************************************************************************************

TASK [Gathering Facts] *******************************************************************************************************************************************************************
ok: [ansible-h]

TASK [geerlingguy.repo-epel : Check if EPEL repo is already configured.] *****************************************************************************************************************
ok: [ansible-h]

TASK [geerlingguy.repo-epel : Install EPEL repo.] ****************************************************************************************************************************************
skipping: [ansible-h]

TASK [geerlingguy.repo-epel : Import EPEL GPG key.] **************************************************************************************************************************************
skipping: [ansible-h]

TASK [geerlingguy.pip : Ensure Pip is installed.] ****************************************************************************************************************************************
changed: [ansible-h]

TASK [geerlingguy.pip : Ensure pip_install_packages are installed.] **********************************************************************************************************************
changed: [ansible-h] => (item={u'name': u'ansible-tower-cli'})

TASK [victorock.tower_config : config.variables: Combine Configuration Hashes from User and Role] ****************************************************************************************
fatal: [ansible-h]: FAILED! => {"msg": "|combine expects dictionaries, got None"}
to retry, use: --limit @/home/ansible/projects/ansible-hetzner/tower_config.retry

PLAY RECAP *******************************************************************************************************************************************************************************
ansible-h : ok=4 changed=2 unreachable=0 failed=1

[ansible@automata ansible-hetzner]$
``

...have you got an idea what could go wrong?
My teams and users config seems to be okay...

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.