Hi there!
I am new to SaltStack and either I am asking a stupid question or was searching for the wrong things.
In my "LAB" down in the cellar, I have 12 Servers of different size and hardware, but all are running the very same Ubuntu 14.04.3 LTS. (Installed from the very same DVD)
- 5 PCs: 4 GB RAM, AMD Semperon 3300+, 80 GB HDD (DC1_Rack1_[12345])
- 4 PCs: 8 GB RAM, AMD Semperon 3600+, 80 GB HDD (DC2_Rack3_[6789])
- 1 Dell 2950: 32 GB RAM, 2 Xeon 5130, 2 x 200 GB HDD (DC4_Rack5_1)
- 1 Dell SC 1435, 32 GB RAM, 2 Xeon 5320, 1 x 500 GB HDD (DC4_Rack5_2)
- 1 Fujitsu Siemens RX 360, 144 GB RAM, 2 Xeon 5530, 5 x 1 TB HDD (Raid 5) (Node12) (DC4_Rack5_3)
One of the 5 PCs (aka "DC1_Rack1_1") is my SaltStack master. On this I have my Mesos 0.24.0 binaries (/var/tmp/mesos/build), that I want to distribute to all (!) other servers.
And here is the jumping comma:
How can I copy these bunch of files (stored in some subdirectories) to the desired /usr/bin/mesos directory?
I tried file.copy, but could not get it to work, the same with file.managed. Both in both ways, as command on CLI and as sls-file. Nothing worked.
Well, at least not as expected.
tmichels@DC1_Rack1_1:/srv/salt$ sudo salt '*' --version
salt 2015.5.3 (Lithium)
tmichels@DC1_Rack1_1:/srv/salt$ cat mesos.sls
copy_mesos:
file.copy:
- name: /usr/bin/mesos
- source:
- salt://var/tmp/mesos/build
- force: True
- recurse: True
- makedirs: True
- preserve: True
- user: tmichels
- group: tmichels
- mode: 755
The error I get is:
tmichels@DC1_Rack1_1:/srv/salt$ sudo salt 'DC1_Rack1_2' state.sls mesos
DZ1_Rack1_2:
----------
ID: sync mesos
Function: file.copy
Name: /var/tmp/mesos
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1560, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/dist-packages/salt/states/file.py", line 3513, in copy
source = os.path.expanduser(source)
File "/usr/lib/python2.7/posixpath.py", line 261, in expanduser
if not path.startswith('~'):
AttributeError: 'list' object has no attribute 'startswith'
Started: 11:32:44.609036
Duration: 5.802 ms
Changes:
Summary
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
tmichels@DC1_Rack1_1:/srv/salt$ cat master
file_roots:
base:
- /srv/salt
- /var/tmp/mesos
- /var/tmp/mesos/build
Maybe I am using the wrong command or in a wrong way? Or am I missing a detail? ...???
Any support or hint is very appreciated.
Thank you very much in advance.
Cheers
Thorsten