【发布时间】:2019-05-22 13:05:47
【问题描述】:
适用于所有机器的通用合理基本配置的 Ansible 角色。应该支持 RHEL/Debian/SuSE/Solaris/HPUX/Ubuntu Linux。
Base 主机配置应执行以下任务:
- ntp – 根据通用配置配置 NTP 设置
- ssh – 配置 SSH 安全、服务、密钥设置
- Package Yum / repo – 配置操作系统本机包管理器以针对内部 HPE 资源和/或外部可用资源(如 ftp.debian.org)进行操作。
我是创建 Ansible 角色的新手。还没试过,求指导。
- name: restart ntp
service:
name: ntp
state: restarted
- name: restart sshd
service:
name: sshd
state: restarted
【问题讨论】:
-
在 ansibles 文档中很好地记录了如何编写角色。 galaxy.ansible.com/docs/finding/…
-
欢迎来到 StackOverflow!如有疑问,请关注How to create a Minimal, Complete, and Verifiable example。
-
谢谢弗拉基米尔
-
@Keith:StackOverflow 在如何评论方面有点具体。恕我直言,请查看帮助中心:do not add a comment on your question or on an answer to say "Thank you".。
-
一些细节也可以在接受和赞成的SO问题How to create ansible galaxy roles in windows?中获得。
标签: ansible ansible-role