One-Click Deployment of Nginx Web Server with Ansible

One-Click Deployment of Nginx Web Server with Ansible

1. Create roles directory mkdir -p ansible_nginx/group_vars mkdir -p ansible_nginx/roles cd ansible_nginx/roles mkdir common nginx mkdir {common,nginx}/tasks mkdir nginx/{files,handlers} mkdir nginx/templates 2. Basic Configuration of Roles cd ansible_nginx 2.1. Hosts Configuration cat hosts [webservers] 192.168.52.16 2.2. site.yml Configuration cat site.yml —- name: Install nginx hosts: webservers remote_user: root roles: – role: common – role: nginx … Read more

Ansible Management of Windows Hosts Error

Ansible Management of Windows Hosts Error

ansible-playbook — – hosts: windows tasks: – name: backup webapp win_shell: ‘move D:\tomcat\WEB-INF D:\Y4ECSRUN\webapp\\WEB-INF-{{ DATE }}bak’ – name: copy package win_copy: ‘src=/ansible-playbook/WEB-INF.zip dest=D:\tomcat\webapp\WEB-INF-{{ DATE }}.zip’ – name: unzip package win_unzip: ‘creates=no src=D:\Y4ECSRUN\webapp\hanwang-test\WEB-INF-{{ DATE }}.zip dest=D:\Y4ECSRUN\webapp\hanwang-test\’ – name: stop java service raw: ‘taskkill /F /IM java.exe /T’ – name: start tomcat service win_command: ‘chdir=D: .\startup.bat’ Execute … Read more

Practical Implementation of MySQL Deployment with Ansible

Practical Implementation of MySQL Deployment with Ansible

1. Overview of Ansible Ansible is an open-source automation tool for IT operations, created by Michael DeHaan in 2012 and acquired by Red Hat in 2015 for over $100 million. It is developed in Python and manages remote nodes via SSH protocol without the need to install any client agents on the controlled end (Agentless). … Read more

Compilation of Standalone Binary for Ansible Playbook

Compilation of Standalone Binary for Ansible Playbook

Background/Cause The internal product involves many Docker images, and distributed installation involves many hosts, so Ansible was used to write deployment scripts. However, there are various issues due to differences in the operating systems of the deployment machines or the installed versions of Ansible. The initial solution to this problem was to build an Alpine … Read more

Deploying LNMP with Ansible Playbook

Deploying LNMP with Ansible Playbook

Table of Contents Deploying LNMP with Ansible Playbook Installing Ansible Basic Preparation with Ansible Writing with Playbook Using Variables Environment Introduction: System IP Hostname Service centos8 192.168.222.250 ansible ansible centos8 192.168.222.137 nginx nginx centos8 192.168.222.138 mysql mysql centos8 192.168.222.139 php php nginx-1.22.0mysql-5.7.38php-8.1.11 Installing Ansible Aliyun Official Website // Configure Aliyun Source [root@ansible~]# cd /etc/yum.repos.d/ [root@ansible … Read more

Automated Deployment of Yudao Project with Ansible

Automated Deployment of Yudao Project with Ansible

Automated Deployment of Yudao Project with Ansible Introduction Ansible is an extremely simple IT automation system. It can be used for configuration management, application deployment, cloud resource configuration, ad-hoc task execution, network automation, and multi-node orchestration. Ansible can easily achieve complex operations such as zero downtime rolling updates (in conjunction with load balancers). Preparation To … Read more

Ansible: From Introduction to Abandonment (Part 20)

Ansible: From Introduction to Abandonment (Part 20)

Ansible Roles Ansible Role is a collection of playbooks. For example, combining the playbook for configuring nginx, the playbook for configuring php, and the playbook for configuring mysql can create a role for configuring lnmp. There are three common types of roles: • The roles that come with RHEL, which can be installed via <span>yum … Read more

Open Source Ansible Playbook Management Platform AWX

Open Source Ansible Playbook Management Platform AWX

1. Introduction to AWX ● AWX is the open-source version of Ansible Tower (the upstream product of the enterprise version), a visual interface server automation deployment and operation management platform. ● AWX provides a web-based user interface, REST API, and a task engine built on Ansible. ● The graphical AWX makes it easier to orchestrate … Read more

Ansible Unarchive Error: ‘Could Not Handle Archive’

Ansible Unarchive Error: 'Could Not Handle Archive'

Today, while trying to use Ansible to extract a local tar package, I received the message “could not handle archive. Command “/usr/bin/unzip” could not handle archive”. This is my YAML file. I intend to extract the files to the bin directory. it@mgt:~/kubelazy$ cat roles/unarchive-pkgs/tasks/main.yml—- name: unarchive kubernetes unarchive: src: bin/kubernetes-server-linux-amd64.tar.gz dest: "bin/" Running which unzip … Read more

Building Ansible Execution Environment Images

Building Ansible Execution Environment Images

Building Ansible Execution Environment Images The construction of Ansible’s execution environment is essentially the construction of a container image, with Ansible providing a command <span>ansible-builder</span> to achieve standardized image building. <span>ansible-builder</span> will by default use the <span>execution-environment.yaml</span> or <span>execution-environment.yml</span> in the current directory as the execution environment definition file (which is the <span>Containerfile</span> or <span>Dockerfile</span>). … Read more