實驗環境
aclsm_server 192.168.1.101
ansible_slave 192.168.1.148
實驗軟件
Aclsm-master.zip
軟件安裝
cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
python --version
Python 2.7.5
yum install -y ansible pyhotn-pip python-devel zip unzip ansible_server操作
yum install -y ansible libselinux-python ansible_slave操作
cp -pv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
echo ClientAliveInterval 600 >> /etc/ssh/sshd_config
echo ClientAliveCountMax 100 >> /etc/ssh/sshd_config
systemctl restart sshd
scp -pr /etc/ssh/sshd_config [email protected]:/etc/ssh/ 開啓ssh持久化
cp -pv /etc/ansible/ansible.cfg /etc/ansible/ansible.cfg.bak && touch /var/log/ansible.log
sed -i 's/#log_path/log_path/g' /etc/ansible/ansible.cfg
sed -i 's/#inventory/inventory/g' /etc/ansible/ansible.cfg
sed -i 's/#remote_user/remote_user/g' /etc/ansible/ansible.cfg
sed -i 's/#host_key_checking /host_key_checking/g' /etc/ansible/ansible.cfg
sed -i 's/# command_warnings/command_warnings/g' /etc/ansible/ansible.cfg
scp -pr /etc/ansible/ansible.cfg [email protected]:/etc/ansible/ansible.cfg
cp -pv /etc/ansible/hosts /etc/ansible/hosts.bak
cat /etc/ansible/hosts
[server]
192.168.1.101 ansible_ssh_user=root ansible_ssh_port=22 ansible_ssh_pass=1
192.168.1.148 ansible_ssh_user=root ansible_ssh_port=22 ansible_ssh_pass=1
scp -pr /etc/ansible/hosts [email protected]:/etc/ansible/hosts
ansible server -a 'cat /etc/redhat-release'
192.168.1.148 | CHANGED | rc=0 >>
CentOS release 6.5 (Final)
192.168.1.101 | CHANGED | rc=0 >>
CentOS Linux release 7.8.2003 (Core)
unzip Aclsm-master.zip && mv Aclsm-master /usr/local/aclsm
cd /usr/local/aclsm/
pip install --upgrade pip
pip install -r requirements.txt
sh install.sh
默認登錄賬號密碼爲:[email protected]/aclsm.com
nohup /usr/bin/python /usr/local/aclsm/manage.py runserver 0.0.0.0:8080 & 啓動服務
nohup /usr/bin/python /usr/local/aclsm/manage.py celery worker -c 5 -B --loglevel=info & 啓動後臺管理
netstat -tuplna | grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 4470/python