Giter VIP home page Giter VIP logo

ansible-artifactory-role's Introduction

JFrog Artifactory OSS Ansible Role

The simpliest Ansible role for JFrog Artifactory OSS 7 that works on Ubuntu 19.10 hosts with init.d.

Role includes all key Artifactory config files in templates/ so you can widely customize your Artifactory installation.

Role requirements

  • Unzip. This role requires unzip package and installs it automatically by itself. If you don't need it, you can remove it in post_tasks section of your playbook.
  • Production Database. Artifactory uses simple lightweigth database called Derby by default. If you don't plan to host high-load/fail-over solution with your Artifactory instance, Derby could be enough. If you plan to use production level database, you have to install and cofigure it yourself in your playbook. Already done Ansible Galaxy roles will help, e.g. geerlingguy.postgresql, geerlingguy.mysql, etc. After you describe database installation and configuration with your playbook, it required to configure Artifactory to work with your database. After you add driver downloading, creating database itself and database user to your playbook, you're required to configure Atrifactory role to work with your just configured database by setting properties artifactory_database_* to correct values. As an example you can take a look at the test playbook with Postgres.

Variable 'ansible_become_method' is used to generate service script. It have default value 'sudo' so if your target host don't have sudo command you have to explicitly set it to 'su'. Because it depends on target hosts linux distr better set it on per-host basis in your inventory file. See example of setting 'ansible_become_method' variable for inventory hosts.

Other variables that could be customized described in defaults/main.yml.

Example requirements.yml to add this role to your playbook

- eugene_krivosheyev.artifactory
- hosts: ci_server
  roles:
    - role: eugene_krivosheyev.artifactory
      artifactory_port: 8081
      artifactory_ui_port: 8082
      artifactory_username: admin
      artifactory_password: P@ssw0rd

Also you can refer test role usage for example.

Known issues

  1. You may face issue if target host don't have command 'sudo'

In this case just set default priviledge escalation command to 'su'. Because it depends on target hosts linux distr better set it on per-host basis in your inventory file. See example of setting 'ansible_become_method' variable for inventory hosts.

  1. You may face issue with 'su' command timeouts if it set as default privilege escalation command for some hosts

TASK [geerlingguy.postgresql : Ensure PostgreSQL Python libraries are installed.] ********
fatal: [test_host]: FAILED! => {"msg": "Timeout (12s) waiting for privilege escalation prompt: "}

In this case set default priviledge escalation command to 'sudo' with 'ansible_become_method' variable explicitely. Better set it on per-host basis in your inventory file. Or just skip setting 'ansible_become_method' at all because of its default is 'sudo' already.

  1. Artifactory tries to start but then get permanent error at web interface

{
  "errors" : [ {
    "status" : 500,
    "message" : "Artifactory failed to initialize: check Artifactory logs for errors."
  } ]
}

And in logs (e.g. /opt/jfrog/artifactory/var/log/console.log) you have

.
Could not validate router Check-url: http://::1:8082/router/api/v1/system/ping
.
.
.
Registration with router on URL http://localhost:8046 failed with error: UNAVAILABLE: io exception.
Registration with router on URL http://localhost:8046 failed with error: UNAVAILABLE: io exception.
Registration with router on URL http://localhost:8046 failed with error: UNAVAILABLE: io exception.
.

This means that one of Artifactory component uses 'localhost' landed to IPv6's "localhost" called '::1'.

To fix you can try force Java to use IPv4 or manually remove binding of IPv6 from 'localhost' at your /etc/hosts:

127.0.0.1       localhost   
::1             localhost  # <-- Remove any type of such binding "::1 -> localhost" at any string 
::1             ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

In case of reproducing issue just turn IPv6 off.

License

BSD

ansible-artifactory-role's People

Contributors

eugene-krivosheyev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

ansible-artifactory-role's Issues

Portable superuser acquisition

Postgres role sometimes stuck depending on target platforms presence of su or sudo.

  • Test portability without setting become_method
  • Make test of presence su / sudo and use appropriate

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.