Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed due to missing data folder at root directory #13

Open
kmcquade opened this issue Jul 7, 2017 · 2 comments
Open

Build failed due to missing data folder at root directory #13

kmcquade opened this issue Jul 7, 2017 · 2 comments

Comments

@kmcquade
Copy link

kmcquade commented Jul 7, 2017

Hi,

I found a fix for this but unfortunately I don't have time to pull/modify/push etc., so I figured I would put it here so you can make the quick update.

Playbook failed here:

TASK [emmetog.jenkins : Create Jenkins user] **********************************************************************************************************************************************************************************************************************************
fatal: [hostname]: FAILED! => {"changed": false, "failed": true, "msg": "useradd: cannot create directory /data/jenkins\n", "name": "ubuntu", "rc": 12}

Manual fix:
If there is no /data directory on the target, create one manually.

This means that I have to add an extra step to my VM creation script to create a /data directory. Obviously that works for me for now, but it would be good to have this fixed / improve the error handling for it so other users don't run into the same issue.

Hope this helps.

@SubOptimal
Copy link

In your playbook you should override the setting for jenkins_home. Based on the error you posted I assume you are installing it on Ubuntu. If you want to use the default Jenkins work directory (defined by the jenkins_x.y.z_all.deb) your playbook could look like

---
- name: your Jenkins install playbook
  hosts: ...

  vars:
    # default Jenkins home 
    jenkins_home: /var/lib/jenkins
    ...

  roles:
    - emmetog.jenkins

@alainchiasson
Copy link

alainchiasson commented Oct 2, 2017

I just ran into this - running on centos with yum.

You are currently setting the default in defaults/main.yml as /data/jenkins.

If it is the case that we must redefine the jenkins_home variable, you should remove it from the default and error out if it is not defined. Otherwise maybe verify/create the directory ?

Just an opinion :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants