项目作者: L-P

项目描述 :
Basic server initialization.
高级语言:
项目地址: git://github.com/L-P/ansible-role-server-init.git
创建时间: 2016-11-17T11:23:31Z
项目社区:https://github.com/L-P/ansible-role-server-init

开源协议:MIT License

下载


server-init

Server initialization, install basic packages, setup basic security stuff and
create ansible user.

This role can be run both as root and as any other sudoer.
This will only disable the root login if it can connect as a sudoer.

Requirements

Role created for Ubuntu 16.04 amd64 and armhf.
become is required to run this role.

Role Variables

Mandatory

  1. # Use this to generate init_user_password_crypted:
  2. # mkpasswd -m sha-512
  3. init_hostname:
  4. init_user_login:
  5. init_user_password_crypted:
  6. init_user_pubkey: # "ssh-rsa (…)"

Optional

  1. # boolean, should we disable ufw ipv6 support, this is needed on some armhf hosts.
  2. init_disable_ufw_ipv6:
  3. # Ports en open, eg.:
  4. init_ufw_open:
  5. - to_port: 80
  6. proto: "tcp"
  7. # Files to write, eg.:
  8. init_files:
  9. - content="foo"
  10. dest="/bar"
  11. owner="root"
  12. group="root"
  13. mode="0600"

Dependencies

None.

Example Playbook

Don’t become on the whole play but on the role. If you become on the whole play
you’ll be root when the fact gathering occurs.
This prevents the role from removing password-authenticated remote root access
as we don’t do it if ansible_user_id is root (to avoid locking ourselves
out).

This also means the role should be run at least twice, once as root to create
the ansible user and once as ansible to remove root access.

  1. - hosts: all
  2. roles:
  3. - {role: "L-P.server-init", become: true}

License

MIT