In this exercise I am going to install LAMP with a help of salt. My virtual ubuntu server at digital ocean will work as a master and give orders to guest os slave which is ubuntu server.
Master: Digital ocean droplet / Ubuntu server 18.04 /1GB memory / 25GB Disk
Slave: Guest OS Ubuntu server 18.04 on Windows 10 host PC
Beginning by cloning my git repository on guest ubuntu so I can use my shell script to make it a slave. After the script has run I accepted the key on my master. Now I have working master-slave architecture.
I wanted to install LAMP only by applying a highstate so everything would be fully automatized. To correctly do this without any bigger hassle on the ubuntu guest machine, I wanted to test every state before applying them so I manually tested every state first at another virtual machine.
Everything worked just fine except mysql.
I left mysql installation for last on purpose, because I remembered it might be a tricky one. I remembered there were something annoying with mysql passwords at the installation, and wondered what would be the easiest way to install it.
Fortunately I found article at terokarvinen.com which was very helpful:
The thing was preseeding, answering questions on installation beforehand.
At first when I applied that state, it froze completely. I got no feedback from salt master whether the state were correctly applied or not. I checked with salt-run jobs.active and saw that the job was still running but nothing happened. I am not sure what was going on there, but I had to quit for that day so I shut everything down.
Few days after that, I came back and changed the password on the sls file and tried to apply it again. It didn’t freeze this time, but I still got some errors.
Time for highstate.