zakzhu / linux-init

Ansible playbook for linux initialization on cloud environment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux-Init

gitter room license release prs welcome

Ansible playbook for linux initialization on cloud environment.

[TOC]

Requirements

  • Platforms:
    • CentOS-7
  • Dependencies:
    • ansible

Installation

  • yum -y install ansible
  • git clone https://github.com/zakzhu/linux-init.git

Usage

  • 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

Contributing

See the contribution guide.

Frequently asked questions

Please see FAQ.md for frequently asked questions.

Thanks

The following excellent people helped massively:

License

Linux-Init is licensed under the LGPL-2.1 license. Copyright © 2020, Zak Zhu

About

Ansible playbook for linux initialization on cloud environment

License:GNU Lesser General Public License v2.1


Languages

Language:Jinja 43.8%Language:Shell 35.1%Language:Vim Script 21.0%