Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the five Ansible modules of Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the relevant knowledge of what the five Ansible modules of Linux are, the content is detailed and easy to understand, the operation is simple and fast, and it has a certain reference value. I believe you will gain something after reading this article on the five Ansible modules of Linux. Let's take a look.

5. Authorized_key

SSH is the core of Ansible, at least for almost all other functions except Windows. The key to efficient use of SSH in Ansible (no pun) is... The key! By the way, you can do a lot of cool things for security with SSH keys. It is worth reading the "authorized_keys" section of the sshd man page carefully. If you need fine-grained user access control, managing SSH keys can be laborious, and although I can use either of the next two my favorite modules, I prefer to use authorized_key because it can be easily managed through variables.

4. File

In addition to the obvious ability to place files somewhere, the file module can also set ownership and permissions. What I want to say is that such a module can bring a lot of benefits. A large part of the security issues are also related to setting permissions, so the file module and authorized_key work well together.

3. Template

There are so many ways to manipulate the contents of a file that I see a lot of people using lineinfile. I've used it for small tasks myself. However, the template module is much clearer because you maintain the context of the entire file. I prefer to write Ansible content in a way that anyone can easily understand-for me, that means it's easy to understand what's going on. The use of template means that you can see the entire file in which you are placing content, all the variables you are changing.

2. Uri

Many modules in the current release use Ansible as an orchestration tool. Instead of doing specific things, such as putting a file in one place, they talk to another service. Usually, this kind of conversation is also conducted through HTTP. Before many of these modules appeared, you could program API directly using the uri module. It is a powerful access tool that enables you to do a lot of things. In my Ansible virtual shed, I won't lose it.

1. Shell

This is the trump card in our toolkit, the Swiss Army knife. If you are very upset about how to control other things, don't say, it's shell. Some people would say that we make Ansible a Bash script-but what I want to say is that it has some advantages, because you can use the name parameter to record every step in your script and character. To me, it's like a big reward. Back when I was still consulting, I helped a database administrator (DBA) migrate to Ansible. The DBA doesn't like change and is a hindrance to changing the way he works. So, in order to simplify the migration to Ansible, we used the shell module in Ansible to invoke some existing database management scripts.

This is the end of the article on "what are the five Ansible modules of Linux?" Thank you for reading! I believe you all have a certain understanding of the knowledge of "what are the five Ansible modules of Linux". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report