Ansible Galaxy """""""""""""" * sharing is caring * community contributed roles * re-useable roles Links ----- * https://galaxy.ansible.com/ * http://docs.ansible.com/ansible/galaxy.html Download / installation of additional roles =========================================== * install a single or multiple roles * define the version of the role * it's also possible to overwrite the rolename with ``name:`` * you can define a server in ``ansible.cfg`` .. code-block:: bash # file: ansible.cfg [galaxy] server=https://galaxy-qa.ansible.com Search galaxy roles ------------------- * querying the Galaxy database * allowing for searching by tags, platforms, author and multiple keywords .. code-block:: bash # search elasticsearch ansible-galaxy search elasticsearch Found 99 roles matching your search: Name Description ---- ----------- williamyeh.elasticsearch Install Elasticsearch bastly.elasticsearch Elasticsearch for Linux Installation of new role ------------------------ .. code-block:: bash # install a single role ansible-galaxy install williamyeh.elasticsearch # list installed roles ansible-galaxy list Installation via requirements.yml --------------------------------- .. code-block:: bash # install multiple roles vi requirements.yml # from galaxy - src: williamyeh.elasticsearch version: 1.1.0 - src: williamyeh.prometheus # from GitHub - src: https://github.com/bennojoy/nginx # from GitHub, overriding the name and specifying a specific tag - src: https://github.com/bennojoy/nginx version: master name: nginx_role # from a webserver, where the role is packaged in a tar.gz - src: https://some.webserver.example.com/files/master.tar.gz name: http-role # from Bitbucket - src: git+http://bitbucket.org/willthames/git-ansible-galaxy version: v1.4 # from Bitbucket, alternative syntax and caveats - src: http://bitbucket.org/willthames/hg-ansible-galaxy scm: hg # from GitLab or other git-based scm - src: git@gitlab.company.com:mygroup/ansible-base.git scm: git version: "0.1" # quoted, so YAML doesn't parse this as a floating-point value # install multiple roles ansible-galaxy install -r requirements.yml # list installed roles ansible-galaxy list - williamyeh.prometheus, 2.3.1 - williamyeh.elasticsearch, 1.0.0 .. hint:: Roles can also be installed directly from source control repos or tar files. .. hint:: You can use the init option of ``ansible-galaxy`` to initialize a role structure for a new role: ``ansible-galaxy init rolename`` Links ----- * http://docs.ansible.com/ansible/galaxy.html#create-roles