my question for the manifest file, pls explain
The Manifest file looks like below
my initial version looks like:
node ;slave1'{
if ['/bin/which apache2']{
include 'docker'
}
Elsif ['/bin/which nginx']{
include 'java'
}
else {
file{'/tmp/hello.txt':
content=> "nothing found",
mode=> '0644',
}
}
}
node 'slave2'{
if ['/bin/which nginx']{
include 'java'
}
Elsif ['/bin/which apache2']{
include 'docker'
}
else {
file{'/tmp/hello.txt':
content=> "nothing found",
mode=> '0644',
}
}
}
I have simplified the above file and it looks like:
node default{
if ['/bin/which apache2']{
include 'docker'
}
if ['/bin/which nginx']{
include 'java'
}
else {
file{'/tmp/hello.txt':
content=> "nothing found",
mode=> '0644',
}
}
}
I tried to simplify the code and make it generic so that it can run in any node and check the case and install the respective version. but after I changed like this, it only checks the if condition and does not go to else condition, it just installs docker on both the slaves
I tried to reverse the code then it just installs Java-- Not sure how to rewrite it
I even tried to modify the original manifest file of slave2 bu changing the apache2 at the beginning then, only docker gets installed
I want to know how exactly the if and elsif conditions are checked?