Skip to content

ryptozee/ansible-bastion-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1, Verified environment: Centos 7 ansible 2.9.10

Need to install ansible first, and create a root public key

yum install epel-release ansible -y

ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''

2, About hosts 2. 1 Modify hosts.ini as needed 2. 2 hosts.ini first acts ansible server, fortress Machine Manager server 2. 2 addnew is a new server added later 2. 4 /etc/ansible/inventory/default-hosts.ini uses the default hosts template for ordinary users, modify as needed

3, vars variable definition, can be modified as needed group_vars / all.yml

  1. Realize function

  2. 1 Batch synchronization of the bastion machine root user key to the server-mainly for the bastion machine root user operation management

  3. 2 Batch synchronization of the bastion host sudo management user key to the server-mainly for the sudo user operation management of ordinary users of the bastion host

  4. 3 Add ordinary users in batch

  5. 4 Quickly build a simple bastion server

  6. How to use ansible -i hosts.ini all -m ping #If you can ping normally, there is no problem with hosts.ini configuration ansible-playbook -i hosts.ini start.yml

6, add a new server 6. 1. First add hosts.ini addnew 6.2 ansible-playbook -i hosts.ini -l addnew start.yml -t addmanager

About

Quickly build a simple bastion server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages