1
votes

I was till last month able to install salt machine without any problem, from then I have not changed anything (this is important).

I'm using Ubuntu server 14.04.

I will write here step by step how I installed every new machine using salt stack (and I have installed many machines almost every day because of some kid of testing).

Steps:

curl -L https://bootstrap.saltstack.com -o bootstrap_salt.sh
sudo sh bootstrap_salt.sh
salt-call --local state.highstate -l debug

Suddenly this error started to showing on every attempt to install new machine, this is one of many errors related to user and groups, but it is first on the list. enter image description here

Something has changed so I have tried to download old bootstrap_salt.sh file and to call old version of salt, for example:

sudo sh bootstrap_salt.sh -P git v2015.8.7

But without any changes, error is still showing up.

Can somebody give me instructions which are working?

Thank you

1
The error you're seeing has nothing to do with the actual install of SaltStack. Can you provide a sanitized version of you salt state? (www-data) - Utah_Dave
Are you sure the 'demo' user is being created? Salt States are not necessarily run in order, so perhaps this state is running before the demo user exists, and it needs to require the 'demo' user. As Utah_Dave said, it would be helpful to see the original salt state definition. - whusterj
@whusterj - Yes. that was the problem. User was not created. Should I remove question or you will post answer? - iWizard
I'll post an answer. - whusterj

1 Answers

2
votes

It looks like the 'demo' user is not being created before the www-data state is being run.

Salt States are not necessarily run in order, so when this state runs before the demo user exists, it will fail. The frustrating thing is that sometimes this state will be applied after the user is created and it will succeed. That's probably why this error seemed to come out of nowhere.

To make sure www-data runs after the user is created, it should require the state that creates the 'demo' user, like so:

www-data:
   group.present:
    - members:
      - demo
    - require:
      - user: demo