diff --git a/Makefile b/Makefile index c0b6bf5c9..72f6312b3 100644 --- a/Makefile +++ b/Makefile @@ -55,7 +55,7 @@ psql: # Build Galaxy images build_from_scratch: - ansible-container --var-file ansible/develop.yml --from-scratch -- -e"@/ansible-container/ansible/develop.yml" + ansible-container --var-file ansible/develop.yml build --from-scratch -- -e"@/ansible-container/ansible/develop.yml" build: ansible-container --var-file ansible/develop.yml build -- -e"@/ansible-container/ansible/develop.yml" diff --git a/ansible/main.yml b/ansible/main.yml index e45ce9691..e7d1e7ca3 100644 --- a/ansible/main.yml +++ b/ansible/main.yml @@ -119,8 +119,8 @@ - nodejs - npm - - name: Install development tools - npm: path=/galaxy + - name: Install node packages + npm: path=/galaxy state=latest - name: Install gulp globally npm: name=gulp global=yes diff --git a/galaxy/static/img/AWX_logo.png b/galaxy/static/img/AWX_logo.png deleted file mode 100644 index c07f70fb7..000000000 Binary files a/galaxy/static/img/AWX_logo.png and /dev/null differ diff --git a/galaxy/static/img/ansible-logo.png b/galaxy/static/img/ansible-logo.png deleted file mode 100644 index 88bc857dd..000000000 Binary files a/galaxy/static/img/ansible-logo.png and /dev/null differ diff --git a/galaxy/static/img/ansible_logo_transparent.png b/galaxy/static/img/ansible_logo_transparent.png deleted file mode 100644 index 9d5ca681f..000000000 Binary files a/galaxy/static/img/ansible_logo_transparent.png and /dev/null differ diff --git a/galaxy/static/img/ansibleworks.png b/galaxy/static/img/ansibleworks.png deleted file mode 100644 index bec551661..000000000 Binary files a/galaxy/static/img/ansibleworks.png and /dev/null differ diff --git a/galaxy/static/img/ansibleworksgalaxy.png b/galaxy/static/img/ansibleworksgalaxy.png deleted file mode 100644 index 3de8518d0..000000000 Binary files a/galaxy/static/img/ansibleworksgalaxy.png and /dev/null differ diff --git a/galaxy/static/img/favicon.ico b/galaxy/static/img/favicon.ico index e0ddbb3ca..05c66adf0 100644 Binary files a/galaxy/static/img/favicon.ico and b/galaxy/static/img/favicon.ico differ diff --git a/galaxy/static/img/galaxy-logo.png b/galaxy/static/img/galaxy-logo.png deleted file mode 100644 index 8753f724b..000000000 Binary files a/galaxy/static/img/galaxy-logo.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logo_main.png b/galaxy/static/img/galaxy_logo_main.png deleted file mode 100644 index 3846d0f86..000000000 Binary files a/galaxy/static/img/galaxy_logo_main.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logo_small.png b/galaxy/static/img/galaxy_logo_small.png deleted file mode 100644 index 6847d8e19..000000000 Binary files a/galaxy/static/img/galaxy_logo_small.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logob.png b/galaxy/static/img/galaxy_logob.png deleted file mode 100644 index e7d793dff..000000000 Binary files a/galaxy/static/img/galaxy_logob.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logoc.png b/galaxy/static/img/galaxy_logoc.png deleted file mode 100644 index 6a14be562..000000000 Binary files a/galaxy/static/img/galaxy_logoc.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logod.png b/galaxy/static/img/galaxy_logod.png deleted file mode 100644 index 5f2a2891b..000000000 Binary files a/galaxy/static/img/galaxy_logod.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logoe.png b/galaxy/static/img/galaxy_logoe.png deleted file mode 100644 index 77d3e489d..000000000 Binary files a/galaxy/static/img/galaxy_logoe.png and /dev/null differ diff --git a/galaxy/static/img/galaxy_logof.jpg b/galaxy/static/img/galaxy_logof.jpg deleted file mode 100644 index 9a5341911..000000000 Binary files a/galaxy/static/img/galaxy_logof.jpg and /dev/null differ diff --git a/galaxy/static/img/logo.png b/galaxy/static/img/logo.png deleted file mode 100644 index a0cbc1676..000000000 Binary files a/galaxy/static/img/logo.png and /dev/null differ diff --git a/galaxy/static/img/logo_clr.png b/galaxy/static/img/logo_clr.png deleted file mode 100644 index 227b7fdf9..000000000 Binary files a/galaxy/static/img/logo_clr.png and /dev/null differ diff --git a/galaxy/static/img/logo_clr_sm.png b/galaxy/static/img/logo_clr_sm.png deleted file mode 100644 index a23706386..000000000 Binary files a/galaxy/static/img/logo_clr_sm.png and /dev/null differ diff --git a/galaxy/static/img/logo_infoworld.gif b/galaxy/static/img/logo_infoworld.gif deleted file mode 100644 index b9207cd87..000000000 Binary files a/galaxy/static/img/logo_infoworld.gif and /dev/null differ diff --git a/galaxy/static/img/redhat-ansible-footer.png b/galaxy/static/img/redhat-ansible-footer.png deleted file mode 100644 index 4e458f932..000000000 Binary files a/galaxy/static/img/redhat-ansible-footer.png and /dev/null differ diff --git a/galaxy/static/js/exploreApp/exploreApp.js b/galaxy/static/js/exploreApp/exploreApp.js index 2c82b7638..310462b62 100644 --- a/galaxy/static/js/exploreApp/exploreApp.js +++ b/galaxy/static/js/exploreApp/exploreApp.js @@ -30,7 +30,7 @@ $logProvider.debugEnabled(debug); $routeProvider. when('/', { - templateUrl: '/static/partials/main.html', + templateUrl: '/static/partials/explore.html', controller: 'ExploreCtrl' }). otherwise({ diff --git a/galaxy/static/less/footer.less b/galaxy/static/less/footer.less index 8afbe8b7f..6eb06a1f9 100644 --- a/galaxy/static/less/footer.less +++ b/galaxy/static/less/footer.less @@ -12,6 +12,7 @@ //left: 50%; //margin-left: -585px; } + #galaxy-footer-blue-line { height: 1px; background-color: #ccc; @@ -70,170 +71,4 @@ font-size: 10px; } } -} - -#galaxy-footer { - background-color: @black; - padding: 30px 0; - - a, a:active, a:visited { - display: block; - width: auto; - color: @white; - } - a:hover { - color: @blue; - } - - h2 { - a { - margin: 0; - font-size: 14px; - text-transform: uppercase; - } - a, a:active, a:visited { - color: @ansible-color; - } - a:hover { - color: @blue; - } - } - - section { - h2 { - margin-bottom: 5px; - } - margin-top: 30px; - a { - line-height: 24px; - } - } - - section:last-of-type { - margin-bottom: 20px; - } - - .left-border { - border-left: 1px solid rgb(51,56,59); - padding-left: 30px; - } - - .free-link, .free-link:active, .free-link:visited { - color: @ansible-color; - line-height: 24px; - text-transform: uppercase; - } - .free-link:hover { - color: @blue; - } - - .social-logos { - margin-top: 60px; - margin-bottom: 20px; - - a:hover { - color: @blue; - border-color: @blue; - } - .github-icon, - .twitter-icon, - .linkedin-icon, - .facebook-icon { - display: inline-block; - vertical-align: top; - border: 2px solid @white; - border-radius: 50%; - width: 40px; - height: 40px; - margin-right: 5px; - color: @white; - } - .twitter-icon i { - padding-top: 5px; - padding-left: 5px; - } - .github-icon i { - padding-top: 4px; - padding-left: 6px; - } - .linkedin-icon i { - padding-top: 2px; - padding-left: 7px; - } - .facebook-icon { - padding-top: 5px; - padding-left: 9px; - } - } - - .banner-container { - text-align: center; - padding: 13px 30px 0 15px; - #ansible-logo { - max-width: 110px; - margin-bottom: 30px; - } - #tower-banner { - border-radius: 2px; - background-color: rgb(255, 88, 80); - width: 100%; - text-transform: uppercase; - color: @white; - padding: 30px 20px; - text-align: left; - h2 { - color: white; - font-size: 18px; - font-weight: bold; - } - h3 { - font-size: 24px; - font-weight: 300; - } - .download-btn { - font-size: 14px; - margin-top: 15px; - text-transform: uppercase; - } - .btn-primary { - border-radius: 3px; - } - .btn-sm { - padding-left: 20px; - padding-right: 20px; - } - } - } -} - - -@media (max-width: 1200px) { - #galaxy-footer { - .banner-container { - #tower-banner { - .download-btn { - font-size: 12px; - } - } - } - } -} - -@media (max-width: 990px) { - #galaxy-footer { - .banner-container { - padding-right: 15px; - padding-bottom: 30px; - } - .left-border { - border-left: none; - padding-left: 15px; - } - } -} - -@media (max-width: 768px) { - #galaxy-footer { - min-height: 1200px; - } -} +} \ No newline at end of file diff --git a/galaxy/static/less/galaxy.less b/galaxy/static/less/galaxy.less index 86a1487e8..5164ef0ee 100644 --- a/galaxy/static/less/galaxy.less +++ b/galaxy/static/less/galaxy.less @@ -55,7 +55,7 @@ @import "fonts"; @import "navbar"; @import "banner"; -@import "info"; +@import "home_content"; @import "footer"; @import "page_title"; @import "tabs.less"; @@ -66,7 +66,6 @@ @import "page_not_found"; @import "social_signup"; @import "user_detail"; -@import "intro_page"; @import "role_detail"; @import "account_landing"; @import "explore"; diff --git a/galaxy/static/less/home_content.less b/galaxy/static/less/home_content.less new file mode 100644 index 000000000..fed7352dd --- /dev/null +++ b/galaxy/static/less/home_content.less @@ -0,0 +1,4 @@ +/* + * Add styles for custom home content here + * + */ \ No newline at end of file diff --git a/galaxy/static/less/info.less b/galaxy/static/less/info.less deleted file mode 100644 index 273be0205..000000000 --- a/galaxy/static/less/info.less +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Info section of home page. - */ - -#galaxy-info { - margin-top: 30px; - margin-bottom: 30px; - - .info-label { - display: inline-block; - vertical-align: middle; - font-size: 24px; - color: @grey; - text-transform: uppercase; - margin-left: 10px; - } - .download-icon, - .share-icon, - .thumbs-up-icon { - display: inline-block; - vertical-align: middle; - width: 40px; - height: 40px; - border-radius: 50%; - i { - color: @white; - padding-top: 5px; - padding-left: 6px; - } - } - .download-icon { - background-color: @ansible-color; - border: 1px solid @ansible-color; - i { - padding-left: 5px; - } - } - .share-icon { - background-color: @blue; - border: 1px solid @blue; - i { - padding-top: 5px; - padding-left: 6px; - } - } - - #featured-section { - background-color: @red; - color: @white; - border-radius: 2px; - - #title .title-text { - padding-left: 3px; - font-size: 24px; - } - - .featured { - padding: 10px; - border-bottom: 1px solid @white; - - .title { - padding-right: 10px; - } - } - - .featured:last-of-type { - border-bottom-right-radius: 2px; - border-bottom-left-radius: 2px; - } - - #featured-role-body { - height: 60px; - width: 100%; - animation-duration: 1.5s; - -webkit-animation-duration: 1.5s; - } - - #featured-author-body { - height: 30px; - width: 100%; - animation-duration: 1.5s; - -webkit-animation-duration: 1.5s; - } - - .upcase { - text-transform: uppercase; - } - - a, a:active, a:visited { - color: @white; - } - - a:hover { - color: #ebebeb; - } - - .controls { - margin-top: 10px; - text-align: right; - a { - padding-right: 3px; - } - font-size: 12px; - a:hover { - color: @blue; - } - } - - .inactive .fa-circle { - display: none; - } - .active .fa-circle { - display: normal; - } - .active .fa-circle-o { - display: none; - } - } - - .content-txt { - text-align: justify; - padding: 15px 0 0 0; - } - pre { - font-size: 12px; - } -} - -@media (max-width: 768px) { - #galaxy-info { - .content-txt { - margin-bottom: 30px; - } - } -} diff --git a/galaxy/static/less/intro_page.less b/galaxy/static/less/intro_page.less deleted file mode 100644 index 6c73c9909..000000000 --- a/galaxy/static/less/intro_page.less +++ /dev/null @@ -1,147 +0,0 @@ -/* - * intro_page.less - */ - - #galaxy-intro-page { - @border-color: #e1e1e1; - - margin-top: 30px; - margin-bottom: 30px; - - h2 { - margin-top: 0; - } - h3, h4 { - margin-top:30px; - } - h5 { - margin-top: 20px; - font-weight: bold; - } - pre { - margin: 15px 0 20px 0; - } - .galaxy-intro-links { - font-size: 13px; - z-index: +1; - width: 234px; - background-color: #f2f2f2; - border-radius: 2px; - border: 1px solid @border-color; - - .galaxy-nav-title { - i { color: #b7b7b7; } - color: #848992; - border-bottom: 1px solid @border-color; - text-align: center; - padding: 15px; - margin-bottom: 10px; - } - - .nav > li > a:hover { - background-color: @white; - border-radius: 2px; - } - .nav > li > a { - padding: 5px 10px 5px 20px; - } - .nav > li > ul > li a { - padding: 3px 10px 3px 20px; - } - .nav >li >a.pad { - padding-left: 40px; - } - .back-to-top-link { - text-align: center; - font-size: 12px; - padding: 15px; - a { - color: #848992; - i { - color: #b7b7b7; - } - } - a:active, - a:visited, - a:hover { - color: #848992; - i { - color: #b7b7b7; - } - } - } - } - - .galaxy-intro-links.affix { - top: 30px; - } - - .galaxy-nav-title { - padding-left: 15px; - font-size: 15px; - color: #848992; - hr { - border-color: #ccc; - padding: 0; - margin-top: 10px; - margin-bottom: 10px; - } - } - - .intro-content { - overflow-y: hidden; - } - - .screen-shot { - border: 1px solid #ebebeb; - border-radius: 2px; - text-align: center; - padding: 10px; - margin: 15px auto; - max-width: 572px; - img { - max-width: 550px; - } - } - } - - @media (max-width: 1120px) { - #galaxy-intro-page { - .galaxy-intro-links { - width: 240px; - } - } - } - - @media (min-width: 1250px) { - #galaxy-intro-page { - .galaxy-intro-links { - width: 240px; - } - .col-lg-3 { - width: 20%; - } - .col-lg-9 { - width: 80%; - } - } - } - - @media (min-width: 1650px) { - #galaxy-intro-page { - .col-lg-3 { - width: 15%; - } - .col-lg-9 { - width: 85%; - } - } - } - - @media (max-height: 700px) { - #galaxy-intro-page { - .galaxy-intro-links.affix { - top: 0; - } - } - } diff --git a/galaxy/static/less/navbar.less b/galaxy/static/less/navbar.less index f0f783ac8..bea5547d7 100644 --- a/galaxy/static/less/navbar.less +++ b/galaxy/static/less/navbar.less @@ -16,6 +16,12 @@ .navbar-brand { height: @navbar-height; padding: 0; + .title { + margin-top: 25px; + font-size: 36px; + text-transform: uppercase; + color: @white; + } } .navbar-default { diff --git a/galaxy/static/partials/main.html b/galaxy/static/partials/explore.html similarity index 100% rename from galaxy/static/partials/main.html rename to galaxy/static/partials/explore.html diff --git a/galaxy/static/partials/footer.html b/galaxy/static/partials/footer.html new file mode 100644 index 000000000..51b6e9883 --- /dev/null +++ b/galaxy/static/partials/footer.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/galaxy/static/partials/role-list.html b/galaxy/static/partials/role-list.html index 9c38edbd6..b8d627075 100644 --- a/galaxy/static/partials/role-list.html +++ b/galaxy/static/partials/role-list.html @@ -94,12 +94,7 @@ - + diff --git a/galaxy/templates/account/email/email_confirmation_message.txt b/galaxy/templates/account/email/email_confirmation_message.txt index 2d86ad995..25dbfbea6 100644 --- a/galaxy/templates/account/email/email_confirmation_message.txt +++ b/galaxy/templates/account/email/email_confirmation_message.txt @@ -4,8 +4,6 @@ You are receiving this email because someone (hopefully you) created an account If you believe you have received this email in error, please disregard it. -If you have any questions regarding this email, or if you have trouble with the link provided above, please contact us at support@ansible.com. +If you have any questions regarding this email, or if you have trouble with the link provided above, please contact support. Thanks! - -The Ansible Team diff --git a/galaxy/templates/account/email/password_reset_key_message.txt b/galaxy/templates/account/email/password_reset_key_message.txt index 375504efd..35b312075 100644 --- a/galaxy/templates/account/email/password_reset_key_message.txt +++ b/galaxy/templates/account/email/password_reset_key_message.txt @@ -6,9 +6,8 @@ If you did not request this password reset, you can safely ignore this email. -If you have any questions regarding this email, or if you have trouble with the link provided above, please contact us at support@ansible.com. +If you have any questions regarding this email, or if you have trouble with the link provided above, please contact support. Thanks! -The Ansible Team {% endblocktrans %} diff --git a/galaxy/templates/base.html b/galaxy/templates/base.html index 081cc725a..c59143da4 100644 --- a/galaxy/templates/base.html +++ b/galaxy/templates/base.html @@ -66,90 +66,6 @@ {% endif %} -{% if site_name == 'galaxy-qa.ansible.com' %} - - -{% endif %} - -{% if site_name == 'galaxy-qa.ansible.com' %} - - -{% endif %} - -{% if site_name == 'galaxy.ansible.com' %} - - - -{% endif %} {% endblock %} diff --git a/galaxy/templates/custom500.html b/galaxy/templates/custom500.html index 2aaa45ddd..e04295d83 100644 --- a/galaxy/templates/custom500.html +++ b/galaxy/templates/custom500.html @@ -11,7 +11,7 @@
500 Server Error

- An error occurred while loading the requested page. Please report this error at Galaxy Issues. + An error occurred while loading the requested page.

diff --git a/galaxy/templates/footer.html b/galaxy/templates/footer.html index 4869e7165..a94081dce 100644 --- a/galaxy/templates/footer.html +++ b/galaxy/templates/footer.html @@ -8,11 +8,8 @@ - - - - diff --git a/galaxy/templates/header.html b/galaxy/templates/header.html index 620959261..0733aa531 100644 --- a/galaxy/templates/header.html +++ b/galaxy/templates/header.html @@ -6,13 +6,12 @@ - {% if ng_controller %} {% else %} - Ansible Galaxy | {% if page_title %}{{ page_title }}{% else %}Find, reuse, and share the best Ansible content{% endif %} + Galaxy{% if page_title %} | {{ page_title }}{% endif %} {% endif %} {% block extra_head %}{% endblock %} diff --git a/galaxy/templates/home.html b/galaxy/templates/home.html index 8e6c00ebb..84c89d9b3 100644 --- a/galaxy/templates/home.html +++ b/galaxy/templates/home.html @@ -21,7 +21,7 @@
-

Ansible Galaxy is your hub for finding, reusing and sharing the best Ansible content.

+

Galaxy is your hub for finding, reusing and sharing Ansible content

{% if not user.is_authenticated %} @@ -38,312 +38,6 @@

Log Into Galaxy with G

-
-
-
-
-
-
Download
-
-

Jump-start your automation project with great content from the Ansible community. Galaxy provides pre-packaged units of work known to Ansible as roles. - Roles can be dropped into Ansible PlayBooks and immediately applied to your infrastructure.

-

Use Browse Roles to find roles for your project. Then download a role onto your Ansible host using the “ansible-galaxy” command that comes bundled with Ansible.

-

For example:

-
-$ ansible-galaxy install username.rolename
-
-

Learn more...

-
-
-
- -
Share
-
-

Be an active member of the community and help other Ansible users by sharing roles you create.

-

Maybe you have a role for installing and configuring a popular software package or a role for deploying software - built by your company. Whatever it is, use Galaxy to share it.

-

Top content authors will be featured, achieving worldwide fame. Or at least, fame on the internet among developers and sysadmins just like yourself!

-

Learn more about creating and sharing roles... -

-
-
- -
-
-
-
- - - - - - +{% include 'home_content.html' %} {% endblock %} diff --git a/galaxy/templates/home_content.html b/galaxy/templates/home_content.html new file mode 100644 index 000000000..ff8a589e5 --- /dev/null +++ b/galaxy/templates/home_content.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/galaxy/templates/intro.html b/galaxy/templates/intro.html deleted file mode 100644 index 8402ccac9..000000000 --- a/galaxy/templates/intro.html +++ /dev/null @@ -1,438 +0,0 @@ -{% extends 'base.html' %} - -{% load galaxyhelpers %} - -{% block general_content %} - -
-
-
- {{ request.path | urlname }} -
-
-
- -
-
- - -
-
-

Welcome to Ansible Galaxy

- -

Ansible Galaxy is Ansible’s official community hub for sharing Ansible roles. A role is the Ansible way of bundling automation content and making it reusable.

-

If you're not familiar with the Ansible role concept, think of include files used in a programming language. An include file allows the programmer to organize code into reusable modules. - Code can be organized into smaller files and grouped by subject matter or function. These discrete pieces of code can then be included as needed into larger programs like building blocks.

-

A role is similar. Instead of creating giant playbooks with hundreds of tasks we can use roles to organize tasks, breaking them apart into smaller more discrete units of work. But a role is more than - just an include file. A role is all the tasks, variables and handlers needed to complete the unit of work. This allows a role to be completely self contained or encapsulated and completely reusable.

-

Using roles also allows us to think about node configuration in terms of modeling. For example, given a set of nodes that should be web servers we can simply apply a web server role to them. We don't have - to think about or write all the tasks needed to configure web servers. All the details are already encapsulated in a web server role - a role you downloaded from Galaxy.

- -

Download Roles

- -

You can find the most popular roles and recently added roles on the Explore page, or use Browse Roles to search all roles available on Galaxy.

-

Download a role onto your Ansible host using the ansible-galaxy command that comes bundled with Ansible.

-

For example:

- -
-$ ansible-galaxy install username.rolename
-
- -

Download Multiple Roles

- -

A list of roles can be specified in a file. Provide roles one per line in the format username.rolename[,version].

-

For example:

- -
-# roles.txt
-user1.role1,v1.0.0
-user2.role2,v0.5
-user2.role3
-
-

Install the roles:

-
-$ ansible-galaxy install -r roles.txt
-
-

Advanced Downloading

- -

Starting in Ansible 1.8 you can download roles from sources other than Galaxy, and control the install path and installed name. To use these - features you will need to create a Yaml file with a .yml extension

-

For example:

-
-# install_roles.yml
-
-# from galaxy
-- src: yatesr.timezone
-
-# from github
-- src: https://github.com/bennojoy/nginx
-
-# from github installing to a relative path
-- src: https://github.com/bennojoy/nginx
-  path: vagrant/roles/
-
-# 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, if bitbucket happens to be operational right now :)
-- 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
-
- -

Install the roles:

- -
-$ ansible-galaxy install -r install_roles.yml
-
- -

Star, Watch and Count

- -

There are multiple ways to gauge the goodness and popularity of a role, and you can use them all to let the community know what you think.

- -

Found a role you really like? Click the GitHub Star button. Your click increases the role's stargazer count, which appears on Galaxy and on GitHub.

-

In addition to starring a role, you can also watch a role. Click the Watch button to become a - watcher and receive updates from GitHub whenever there is an update to the role. Your click increases the watchers count on Galaxy and on GitHub.

-

We're also tracking downloads. Each time a role is downloaded and installed with the ansible-galaxy command line tool the download count on Galaxy rises. The count is limited to one per IP address. It's not a perfect measurement, but it gives you a feel for how popular a role is.

- -

Create and Share

-

Roles can be used for automating a wide variety tasks, anything from the steps in your CI/CD workflow to packaging and distributing a product your company makes. To demonstrate the process of - creating and sharing a role, as well as highlight some best practices to follow when creating roles, let's go through the steps to create a simple role called acme that will install the Acme web server.

- -

First, create a new repository on GitHub called ansible-role-acme. Once created, clone the repository locally:

- -
-$ git clone https://username@github.com/username/ansible-role-acme.git acme
-
- -

Next, use ansible-galaxy to create the role scaffolding:

- -
-$ ansible-galaxy init acme --force
-
-

This creates the directory structure needed for organizing your code:

-

-acme/
-    .travis.yml
-    README.md
-    defaults/
-    files/
-    handlers/
-    meta/
-    tasks/
-    templates/
-    tests/
-    vars/
- 
-

For more about developing a role and the details behind each of the above components see - the Roles chapter at the Ansible Docs site. -

- -

Good Practices

-

When developing a role there are a few practices you should always follow to help potential users discover your role and - make it easy for them to get started:

-
    -
  • Provide clear documentation in the README.md.
  • -
  • Give accurate information in meta/main.yml.
  • -
  • Include dependencies in meta/main.yml.
  • -
  • Prefix variable names with the role name.
  • -
  • Integrate your roles with Travis CI. See how.
  • -
-

Sticking to these practices will help you create great roles. The community will love you, and you'll be a hero!

- -

README.md

-

The init command provides a template README.md file. Tailor it to fit by providing a - summary of the tasks the role performs, possible use cases, parameters and defaults, and any information users will need in - order to successfully run the role

-

The file is composed in GitHub markdown. - Make modifications using markdown to ensure the document looks good on Galaxy and on GitHub.

-

For example:

- -
-# README.md
-# Ansible Role: Acme 2.x
-
-An Ansible role that installs Acme 2.x on Centos 7.x
-
-## Requirements
-
-If you are using SSL/TLS, you will need to provide your own certificate and key files. You can generate a self-signed certificate with a command like `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout example.key -out example.crt`.
-
-## Role Variables
-
-Available variables are listed below, along with default values:
-
-    acme_listen_port: 80
-    acme_listen_port_ssl: 443
-
-## Dependencies
-
-- username.iptables - configure the firewall and block all ports except those needed for the web server and ssh access.
-- username.common - perform common server configuration
-
-## Example Playbook
-
-    - hosts: webservers
-      roles:
-        - { role: username.acme }
-
-## License
-
-MIT
-
-

Meta Data - meta/main.yml

- -

In meta/main.yml is where you provide a description, a list of supported platforms, a minimum required Ansible version, - a list of search tags, and any dependencies. All this information will appear on Galaxy. If it's not accurate, users may not be able to find - your role.

-

Using ansible-galaxy init provides a template file for you to modify. It's written in YAML, so be sure to follow the YAML standard as you make changes.

-

An example for the acme role might look like the following:

- -
----
-galaxy_info:
-  author: John Doe
-  description: Quick and easy acme web installer.
-  company: Acme
-  license: MIT
-  min_ansible_version: 1.9
-  platforms:
-  - name: EL
-    versions:
-    - all
-  galaxy_tags:
-    - acme
-    - installer
-    - web
-dependencies:
-  - { role: username.common, some_parameter: 3 }
-  - { role: username.iptables, open_port: 80 }
-
-

Tags

-

Provide any tag values you feel will help users find your role. The number of tags imported by Galaxy is limited to 20, and values containing non-alphanumeric characters will be ignored.

-

Values containing a : will be split into multiple tags. For example, cloud:ec2 will become two tags: cloud and ec2.

-

The idea behind tags of course is to help users find your role, so to that end include broad terms such as database or networking as well as more specific keywords like: - MySql, Cisco, ASR, TFTP, etc.

-

Dependencies

-

Add any roles that your role depends on. Ansible will download and execute dependencies before running your role. Specify role names by providing the Galaxy author's username and the - name of the role in the format username.rolename.

-

For example:

-
-dependencies:
-  - { role: stouts.elasticsearch }
-
-

Parameters can also be passed to the role:

-
-dependencies:
-  - { role: stouts.elasticsearch, elasticsearch_home: "{{ install_path_variable }}", elasticsearch_http_port: 8900 }
-
-

For more on adding dependencies, see - Role Dependencies on the Ansible - docs site..

- -

Variable Names

-

Variables are defined in defaults/main.yml and vars/main.yml Always prefix variable names with the role name. This - prevents variable name collision between roles. For example, use acme_foo rather than just foo - -

Test It

-

The actual work to be performed gets added as playbook tasks to tasks/main.yml. Once you've added some tasks, create a playbook to test the role and insure it works. Here's a simple playbook - to execute your new role:

-
-# test.yml
-# test playbook
-- hosts: example
-  roles:
-  - { role: acme }
-
-
-$ ansible-playbook test.yml
-
-

Testing your role is a good practice, and to make it easier, you can automate with Travis CI. See the Automated Testing with Travis CI section for a guide on how to connect your role to Travis. - -

Upload to Galaxy

- -

Once you finish development, push your changes to GitHub by running the following from within the project directory:

-
-$ git commit -a
-$ git push
-
- -

Next, log into Galaxy and click on My Roles, and you will see a list of your GitHub repositories. If you don't see the nrew repository, click the refresh button:

- -
- -
- -

Uploading a role is as simple as flipping a switch. Just toggle the switch to the left of the repository name so that you see a check mark, and the import process - will start.

- -
- -
- -

To see the status and detailed output, click the button to the right of the name.

- -
- -
- -

That's all there is to it. Pretty simple. As you iterate on your role, you can trigger a new import by going to either My Roles or My Imports and - clicking - -

Versions

-

If you applied any tags to your repository, Galaxy will automatically display a “version” for each tag. This means users can choose the version (tag) to download.

- -

The default behavior, if there are no tags, is to make the “HEAD” version available. This means users downloading the role will always get the latest from the github repository.

- -

To import new tags, trigger a new import by visiting either My Roles or My Imports and clicking

- -

Automated Testing

- -

Testing your roles is a great practice. Automated testing is even better, and we've made it easy for you to add Travis CI to your roles.

- -

Add your Travis token to any role you want to integrate. Your token is not stored in Galaxy. It is used to calculate a hash as described in the Travis documentation and then discarded.

- -

Add the token on My Roles:

- -
- -
- -

Enable the repo on your Travis profile page:

- -
- -
- -

Add a .travis.yml file to your repo that includes a notifications section with webhooks pointed to the galaxy server as pictured below:

-
-notifications:
-    webhooks: https://galaxy.ansible.com/api/v1/notifications/
-
- -
-

NOTE: For a full .travis.yml example run ansible-galaxy init. Starting in Ansible 2.0 the generated scaffolding includes a working .travis.yml file and related tests folder.

-
- -

Push the changes to your GitHub repo. This will kick-off a Travis build. When the build completes, Travis will notify Galaxy, and your role will be automatically imported into Galaxy with a Travis badge:

- -
- -
- -

Specify a Branch

- Notifications from Travis will be accepted for the GitHub repo's default branch (usually master). If you want to set a specific branch that notifications will be accepted from, define github_branch in meta/main.yml: -
-galaxy_info:
-    galaxy_info:
-    author: Me
-    description: Testing role imports.
-    ...
-
-    github_branch: release
-    
-    ...
-
-

NEW: Role Types

-

The release of Ansible Container 0.2.0 introduces two new role types that are now supported in Galaxy. Ansible Container - brings the power and flexibility of Ansible to managing and orchestrating containers, and the new role types make it easy to share the tools and applications you create. -

- -

Container Enabled

-

Container enabled roles provide building blocks for Ansible Container projects. A project typically defines multiple services that work together to form an application. For example, a project - might include a web server and a database service. Rather than starting from scratch to define each of these services, now you can simply download a container role that does it for you. Install - the role into your project, and adjust it to fit your needs.

-

It's similar to pulling a Docker image, but better! When you install the role, it updates your orchestration document container.yml with settings and defaults, and adds any build - tasks to your main.yml. No more lost time sifting through the README or the Dockerfile. Just install it, and the work is done for you. Want to see how the service works or change - settings? No problem. Open your contianer.yml, and everything you need is there.

- -

The role contains a service definition in meta/container.yml, along with defaults for the service's container settings in defaults/main.yml, and a list of tasks for - building the service's image in tasks/main.yml. It's everything needed to build an image and launch a container. All you have to do is run - ansible-container install to plug it into your project. - -

When the role is installed, the following tasks are performed by Ansible Container:

- -

    -
  • meta/container.yml will be added to ansible/container.yml along with any defaults found in defaults/main.yml
  • -
  • a new play will be added to ansible/main.yml with hosts set to the service name
  • -
  • any tasks defined in tasks/main.yml will be added to the play
  • -
- -

Container App

- -

A Container App is designed to distribute a complete applications that's been defined in Ansible Container. It contains one or more services ready to run. Just download and go. Use it as - defined, or use it as the starting point for a new project. Either way, it has everything you need to be up and running in moments.

- -

The role contains a complete Ansible Container project. Everything needed to launch the application from the ansible directory to application sourcecode is included. Download - it by running the ansible-container init command.

- -

For example:

-
-    $ mkdir example
-    $ cd example
-    $ ansible-container init <role name>
-    $ ansible-container build
-    $ ansible-container run
-    
-

That's it! With a Conatainer App it's now easier than ever to distribute applications, jump-start projects, and get work done. We can't wait to see what you create!

- -

For more information about Ansible Container, visit the project repo, or check out the - doc site.

- -

Questions?

- -

If you have unanswered Galaxy questions, feel free to ask on the Ansible mailing list. Found a bug or have a suggestion? Let us know at Galaxy Issues.

-
-

NOTE: Contents, usage and bugs related to specific roles will not be supported on the mailing list. Contact the role author via GitHub. The role details provided in Galaxy include a link to the GitHub repository, and when available, the issue tracker.

-
-
-
-
-
-{% endblock %} diff --git a/galaxy/templates/master.html b/galaxy/templates/master.html index a25556246..194712b64 100644 --- a/galaxy/templates/master.html +++ b/galaxy/templates/master.html @@ -14,7 +14,7 @@ - +
galaxy