There are no stupid questions but there bad ones, IMHO.
Someone who shall remain nameless, just asked me some bad questions about Saltstack. I hope by sharing this I can help you guys out as you’re learning about Saltstack in particular, or another tool like git or systems administration/devops in general or really anything.
He started off politely which is good.
**********: (13:11)
Hey Charles, gotta minute for Salt question?
Charles Baker: (13:11)
Shoot
**********: (13:13)
first - do you know if the salt modules for "parted" and "extfs" are installed?
Second - can you tell me how to run a module command locally?
I tried "salt-call parted.partition.list /dev/xvdb" but get module "parted" not available.
The above is only okay. He did tell me exactly what he tried in the 2nd question. But he had already made an assumption about the root cause in question 1st. BTW, these are not the worst questions I've ever received, but they pushed me over the edge.
Charles Baker: (13:13)
What environment are you in?
********** (13:14)
Staging
Above is a bad question on my part, I started to buy into his idea that there was something wrong with the Saltstack masters. I should have started with the next question, as I looked at the documentation myself to be sure I understood what was wrong, if anything.
Charles Baker: (13:15)
Did you look at the documentation for the parted module?
**********: (13:16)
yes - it's not very helpful to me.doesn't say how to run that from a minion, just a master.Also, i'm still not certain the module is installed on the master
Charles Baker: (13:16)
The above question isn’t really his fault. I don’t think anyone in Cloud Operations at my current gig has had Saltstack training except me and I had that on my previous job. But it does show a fundamental lack of understanding about Saltstack. I think it’s kinda’ unfair to expect that everyone can pick up a complex tool like Saltstack and learn it on their own. However, the question is good in that he admitted that the documentation wasn’t helpful to him.
**********: (13:16)
i guess i could try to install the module on the minion, but don't knkow how to do that either
The above is not good troubleshooting technique. It’s “try something, even something I don’t know how to do, and hope it solves my problem."
Charles Baker: (13:17)
Try to run the command with the proper syntax first
Charles Baker: (13:17)
The command syntax from the master is nearly the same as for salt-call
Charles Baker: (13:18)
Except you don’t have to specify a target, ‘*’, for example
**********: (13:18)
[root@******** ~]# salt-call parted.partition.list /dev/xvdb
Module 'parted' is not available.
He repeats the same command, obviously not having paid attention to command line example I linked to above.
Charles Baker: (13:19)
Look at the documentation
Charles Baker: (13:19)
you’re not calling it correctly
**********: (13:20)
ah - it is trying to be smart.should just use partition.list, not parted.partition.list
Charles Baker: (13:20)
Yes, exactly like it is in the document
**********: (13:21)
Tx
And here is what the proper syntax and execution looks like.
[ec2-user@******* ~]$ sudo salt-call partition.list /dev/xvda1
[INFO ] Executing command 'parted -m -s /dev/xvda1 print' in directory '/root'
local:
----------
info:
----------
disk:
/dev/xvda1
interface:
unknown
logical sector:
512
model:
Unknown
partition table:
loop
physical sector:
512
size:
32.2GB
partitions:
----------
1:
----------
end:
32.2GB
file system:
flags:
number:
1
size:
32.2GB
start:
0.00B
type:
ext4
[ec2-user@******** ~]$
Be willing to be vulnerable. Admit that you don’t know something rather than assuming something is wrong with the tool. Ask clear, precise questions. For example:
Got a minute?I tried the following command and it didn’t work as I expected it to work (provide output or a screenshot). I also looked at the documentation but I’m not sure I understand it. The example commands seem to be illustrating what you do on the Saltstack master and not on a minion with salt-call. Can you help me understand what is going wrong?