Ansible playbook for linux initialization on cloud environment.
[TOC]
- Platforms:
- CentOS-7
- Dependencies:
- ansible
-
yum -y install ansible
-
git clone https://github.com/zakzhu/linux-init.git
-
cd linux-init
-
vim inventories/staging/host_vars/localhost.yml
# EXAMPLE: sys_account_primary_groups variable # sys_account_primary_groups: # group1: # name: # gid: # group2: # name: # gid: # # ... #sys_account_primary_groups: # EXAMPLE: sys_account_secondary_group variable # sys_account_secondary_groups: # group1: # name: # gid: # group2: # name # gid: # # ... #sys_account_secondary_groups: # EXAMPLE: sys_account_users variable # sys_account_users: # user1: # name: # comment: # uid: # # optionally sets the user's primary group # primary_group: # # type: list # secondary_groups: # home: # shell: # # plain text # password: # # type: bool # needs_generate_ssh_key: # user2: # # ... # # ... #sys_account_users: ascii_banner_company: Your Company chrony_ntp_servers: - ntp1.aliyun.com - ntp2.aliyun.com - time1.cloud.tencent.com - time2.cloud.tencent.com resolv_nameservers: - 223.5.5.5 - 223.6.6.6 yum_repos_mirrors_hosts: - "mirrors.aliyun.com" - "mirrors.cloud.tencent.com" - "mirrors.huaweicloud.com" - "mirrors.tuna.tsinghua.edu.cn" - "mirrors.ustc.edu.cn"
-
ansible-vault encrypt inventories/staging/host_vars/localhost.yml
-
ansible-playbook --ask-vault-pass -i inventories/staging/hosts.ini site.yml
See the contribution guide.
Please see FAQ.md for frequently asked questions.
The following excellent people helped massively:
Linux-Init is licensed under the LGPL-2.1 license. Copyright © 2020, Zak Zhu