

Ansible Quickie Fixing a Poorly Designed Galaxy Role
source link: https://fuzzyblog.io/blog/ansible/2016/10/09/ansible-quickie-fixing-a-poorly-designed-galaxy-role.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Ansible Quickie Fixing a Poorly Designed Galaxy Role
Oct 9, 2016
Update: This really, really doesn't work. Please read my revised Sidekiq post.
Earlier today I used an Ansible Galaxy role to set Sidekiq as a background process started with an Ubuntu Upstart service. Unfortunately when I went to run the service, I found that it would not start at all. While I like the concept of Ansible Galaxy, I have described it as:
Galaxy is DockerHub without the stars for ratings
I was on the phone with Nick Janetakis yesterday, shooting the breeze as it were and he agreed but offered a slightly different perspective:
Galaxy is DockerHub without the approved packages
Either one is true. There are lots of great options on Galaxy but it is a bit of a crap shoot. Let's diagnose the problem and see how it can be fixed. Here's what the install looked like:
ansible-galaxy install crushlovely.sidekiq-upstart,v1.0.0
- downloading role 'sidekiq-upstart', owned by crushlovely
- downloading role from https://github.com/crushlovely/sidekiq-upstart/archive/master.tar.gz
- extracting crushlovely.sidekiq-upstart to /usr/local/etc/ansible/roles/crushlovely.sidekiq-upstart
- crushlovely.sidekiq-upstart was installed successfully
Here's how to use this in your playbook:
- { role: crushlovely.sidekiq-upstart, app_path: "/var/www/apps/banks", server_env: "production", tags: sidekiq}
That can go anywhere in your playbook after Sidekiq is installed.
There are two problems with this role.
- The first is a syntactic bug identified here.
- The second is that while there are several variables for this, there isn't a variable for the username the rails process runs as. This causes the upstart job to die before it starts because there is a hard coded deploy username.
Here are the workarounds:
- In the meta directory below were the role was installed, modify the file main.yml and comment out the version.
- In your group_vars directory, modify the file all to include a user_name variable set to whoever you want the rails process to run as.
- In the install directory for the role, find the sidekiq_init.j2 template (in the templates directory) and modify setuid deploy to be **setuid **. After that do the same thing for the setgid bit.
That was sufficient to get this running for me. Perhaps next time we'll fork this role into our github and fix the bug properly with Ansible variables.
Posted In: #ansible #galaxy #sidekiq #ansible-galaxy
Recommend
-
14
Ansible Error Fixing ControlPath Too Long Error Dec 29, 2016 If you get the ansible error ControlPath Too Long Error then all you need to do is create an ansible.cfg file in the directory where you ru...
-
8
Ansible Quickie - Checking the Memory Status on All Machines Oct 8, 2016 As I've related in depth, I've been dealing with a problem of reliability and it is looking like its a memory issue. Now there are lots...
-
10
Ansible Quickie - Turning Off Services On A Group of Machines Oct 5, 2016 In my continuing investigation of
-
9
Raymond CamdenDevRel at Adobe, Star Wars nerd, Web/Serverless hacker, lover of good beer and good books. Oh, and cats.
-
5
Queries for Finding Poorly-Designed MySQL Schemas and How to Fix Them Back to the Blog
-
12
An Ansible role tested with Molecule in Gitpod Leave a reply
-
6
Bad Product Design – 3 Examples of Poorly Designed Products
-
10
My Ansible Role for “Oh My Zsh” and other CLI programs Leave a reply...
-
12
What happens when cookie banners are poorly designed?An examination of cookie popups and why they should be designed with trust and privacy in mind.Pub...
-
9
My Ansible Role for KDE Leave a reply I have already started bl...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK