Attributes
-
An attribute is a specific detail about node, Attributes are use by chef to understand
- The current state of node
-
Attributes are defined by
- The nodes as saved on the chef infra server
- Attributes passed via JSON file Refer Here for understanding JSON and yaml formats
- Cookbook
- Roles
- Environments
-
Refer Here for the lamp server cookbook with attributes
-
Refer Here for the correction.
Scenario: Tomcat
- Refer Here for installing tomcat on ubuntu 18.04
- Make a note of all the manual steps
- Create a ubuntu 18 VM and execute the manual steps to verify if they are working
- Manual Steps
- sudo apt update
- sudo apt-cache search openjdk
- sudo apt install openjdk-8-jdk -y
- java -version
- sudo groupadd tomcat
- sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
- cd /tmp/
- wget https://mirrors.estointernet.in/apache/tomcat/tomcat-9/v9.0.46/bin/apache-tomcat-9.0.46.tar.gz
- sudo mkdir /opt/tomcat
- sudo tar xzvf apache-tomcat-*tar.gz -C /opt/tomcat –strip-components=1
- cd /opt/tomcat
- sudo chgrp -R tomcat /opt/tomcat
- sudo chmod -R g+r conf
- sudo chmod g+x conf
- sudo chown -R tomcat webapps/ work/ temp/ logs/
- sudo nano /etc/systemd/system/tomcat.service
- sudo systemctl daemon-reload
- sudo systemctl start tomcat
- sudo systemctl status tomcat