当前位置:网站首页>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
边栏推荐
- Principles of BTC cryptography
- (subplots用法)matplotlib如何绘制多个子图(轴域)
- Disassembly and installation of Lenovo r7000 graphics card
- DEX net 2.0 for crawl detection
- 2022.6.30DAY591
- Why is go language particularly popular in China
- 期末复习DAY8
- Robot capture experiment demonstration video
- 配置xml文件的dtd
- Introduction to rust Foundation (basic type)
猜你喜欢

DEX net 2.0 for crawl detection

(subplots usage) Matplotlib how to draw multiple subgraphs (axis field)

Go practice -- factory mode of design patterns in golang (simple factory, factory method, abstract factory)

Go practice -- gorilla / websocket used by gorilla web Toolkit

联想R7000显卡的拆卸与安装

Deploy crawl detection network using tensorrt (I)

Analysis of the example of network subnet division in secondary vocational school

Why should we rewrite hashcode when we rewrite the equals method?

【一起上水硕系列】Day 10

@Solutions to null pointer error caused by Autowired
随机推荐
Yolov5 model construction source code details | CSDN creation punch in
2022.6.30DAY591
【无标题】
Export the altaro event log to a text file
EMD distance - example of use
【无标题】
期末复习(DAY7)
Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
Best practices for setting up altaro VM backups
Source insight automatic installation and licensing
Primary school campus IP network broadcasting - Design of primary school IP digital broadcasting system based on campus LAN
Classification and discussion of plane grab detection methods based on learning
期末复习(DAY6)
Explanation of several points needing attention in final (tested by the author)
About debugging the assignment of pagenum and PageSize of the formal parameter pageweb < T > (i.e. page encapsulation generic) in the controller
College campus IP network broadcasting - manufacturer's design guide for college campus IP broadcasting scheme based on campus LAN
Pytorch through load_ state_ Dict load weight
期末复习(Day2)
Brief introduction of realsense d435i imaging principle
SimpleITK学习笔记