IT administrators are regulary tasked with server setup, installation of full application stacks, configuration of various files, and permission management. To optimize IT operational efficiency and mitigates misconfiguration risks, configuration automation emerges as a strategic solution to handle these tasks accurately and reliably. You’ll learn how to use Automation Config to automate application configuration.
/POV/config-management/linux/opencart/install_opencart.sls
install_opencart.sls
open its SaltStack State File
# Creating User
section, examine its YAML
{% set username = salt['pillar.get']('user') %}
{% set password = salt['pillar.get']('pass') %}
# Creating User
{{username}}:
user.present:
- fullname: {{username}}
- shell: /bin/bash
- home: /home/{{username}}
- groups:
- sudo
/POV/config-management/linux/opencart/install_opencart.sls
# Packages Needed for Install
section and examine its YAML
# Packages Needed for Install
needed-pkgs:
pkg.installed:
- pkgs:
- mysql-server-8.0
- mysql-client
- unzip
- open-vm-tools
- apache2
- php
- php-mysql
- libapache2-mod-php
- php-cli
- php-common
- php-intl
- php-gd
- php-mbstring
- php-xml
- php-zip
- php-curl
- php-xmlrpc
- python3-mysqldb
- python3-pyinotify
/POV/config-management/linux/opencart/install_opencart.sls
# Final Script Configuration
section and examine its YAML
# Final Script Configuration
opencart:
cmd.script:
- name: setup.sh {{username}} {{password}}
- source: "salt://POV/config-management/linux/opencart/setup_opencart.sh"
- onlyif: 'test ! -e /var/www/opencart'
/POV/config-management/linux/opencart/setup_opencart.sh
setup_opencart.sh
open its Linux Shell Script
Deploy OpenCart for Linux
Install OpenCart and run setup script
salt
Linux
state.apply
base
POV.config-management.linux.opencart.install_opencart
{
"user": "holuser",
"pass": "VMware1!"
}
Deploy OpenCart for Linux
(the job you have created in the previous task)false
base
Automation Config automates application deployment reliably: