当前位置:网站首页>Ansible firewall firewalld setting
Ansible firewall firewalld setting
2022-07-03 05:37:00 【Shuibutian】
ansible A firewall firewalld Set up
background
A firewall By organically combining all kinds of software and hardware equipment for safety management and screening , Help the computer network in it 、 Build a relatively isolated protective barrier between the external networks , A technology to protect user data and information security .
As far as computers are concerned, firewalls are divided into hardware and software , This article starts from the firewall of software , Introduce the firewall technology of the operating system .
Firewall setting is one of the common operations in the process of program deployment . This article ansible Introduction to the carrier , Traditional firewall settings reference 《centos7 Firewall settings 》
demand
Switch the firewall for the assigned server 、 Port policy and service settings .
operation
ansible Operation firewall involves three parts in this chapter
- Switch of firewall
- Firewall port policy
- Firewall service policy
Switch of firewall
The switch of firewall uses ansible Medium service service
open
# Turn on firewalld service
- hosts: middleware
# Remote task execution user
remote_user: root
# Task list
tasks:
# Get service information in the system
- name: checking service
ansible.builtin.service_facts:
# Statement
- name: Turn on firewalld A firewall
service:
name: firewalld
state: started
enabled: yes
when: ansible_facts.services['firewalld.service'] is defined
If you need to turn off the firewall state The status is set to stopped
verification
$ ansible middleware -a 'systemctl status firewalld' -i hosts
Firewall port policy
open
# Set up firewalld Port policy
- hosts: middleware
# Remote task execution user
remote_user: root
# Task list
tasks:
# Statement
- name: Set up firewalld Port policy
firewalld:
port: 8848/tcp
state: enabled
permanent: yes
immediate: yes
verification
$ ansible middleware -m shell -a 'firewall-cmd --lists-ports' -i hosts
Firewall service policy
open
# Set up firewalld Service strategy
- hosts: middleware
# Remote task execution user
remote_user: root
# Task list
tasks:
# Statement
- name: Set up firewalld Service strategy
firewalld:
service: http
state: enabled
permanent: yes
immediate: yes
verification
$ ansible middleware -m shell -a 'firewall-cmd --lists-services' -i hosts
边栏推荐
- 谷歌 | 蛋白序列的深度嵌入和比对
- Altaro requirements for starting from backup on Hyper-V
- Troubleshooting of 32GB Jetson Orin SOM failure to brush
- Gan network thought
- Congratulations to musk and NADELLA on their election as academicians of the American Academy of engineering, and Zhang Hongjiang and Fang daining on their election as foreign academicians
- Go practice -- generate and read QR codes in golang (skip2 / go QRcode and boombuilder / barcode)
- Deep embedding and alignment of Google | protein sequences
- 2022.DAY592
- 期末复习DAY8
- 2022.7.2 simulation match
猜你喜欢
Brief introduction of realsense d435i imaging principle
Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)
今天很多 CTO 都是被干掉的,因为他没有成就业务
Analysis of the example of network subnet division in secondary vocational school
中职网络子网划分例题解析
求质数的方法
Altaro set grandfather parent child (GFS) archiving
Progressive multi grasp detection using grasp path for rgbd images
Shanghai daoning, together with American /n software, will provide you with more powerful Internet enterprise communication and security component services
"C and pointer" - Chapter 13 advanced pointer int * (* (* (*f) () [6]) ()
随机推荐
Jetson AGX Orin 平台移植ar0233-gw5200-max9295相机驱动
Can altaro back up Microsoft teams?
ninja: build stopped: subcommand failed.
Go practice - gorilla / handlers used by gorilla web Toolkit
期末复习(day3)
Map的扩容机制
期末复习(Day2)
獲取並監控遠程服務器日志
大二困局(复盘)
Latest version of source insight
AtCoder Beginner Contest 258(A-D)
Redis encountered noauth authentication required
Disassembly and installation of Lenovo r7000 graphics card
Beaucoup de CTO ont été tués aujourd'hui parce qu'il n'a pas fait d'affaires
Webrtc M96 release notes (SDP abolishes Plan B and supports opus red redundant coding)
Congratulations to musk and NADELLA on their election as academicians of the American Academy of engineering, and Zhang Hongjiang and Fang daining on their election as foreign academicians
Talk about how to use p6spy for SQL monitoring
Rust基础入门之(基本类型)
Common interview questions of microservice
Go practice -- generate and read QR codes in golang (skip2 / go QRcode and boombuilder / barcode)