Giter Club home page Giter Club logo

ansible-role-baseline's Introduction

Ansible Role: Base System

Ansible role that configures a host to a baseline configuration. This role performs the following tasks:

  • Installs common system utilities and guest agents for hypervisors (currently only QEMU)
  • Configures the system hostname, locale, timezone, and OpenSSH
  • Manages local users and groups
  • Installs customized default configurations for tmux and vim

Requirements

None.

Currently, this role has only been tested on Debian systems.

Role Variables

Packages

  • system_packages: List of packages to install. By default, some common utilities, such as bash, nano, htop, rsync, and vim will be installed.
  • system_packages_extra: Extra packages to install on a per-host or per-group basis.
  • system_packages_state: Install the mentioned packages

Timezone, locale, hostname

  • system_hostname: System hostname
  • system_timezone: System timezone, using tz database format, example: America/Chicago
  • system_locale: System locale, example: en_US.UTF-8

Guest agent

  • system_qemu_agent_install: Install the QEMU guest agent if KVM is the detected hypervisor
  • system_qemu_agent_package: QEMU Guest Agent package name (qemu-guest-agent)
  • system_qemu_agent_service_name: QEMU Guest Agent service name (qemu-guest-agent)
  • system_qemu_agent_service_state: Start the guest agent service
  • system_qemu_agent_service_enabled: Enable the guest agent service on boot

Users and groups

  • system_users: Users managed by Ansible, in the format of:
# - name: User name
#   uid: User ID number
#   comment: Comment/GECOS field
#   password_hash: Password generated by `mkpasswd --method=sha-512`
#   groups: List of groups to add the user to
#   shell: User's shell, defaults to system_default_shell
#   state: User state, defaults to system_user_default_state
  • system_groups: Groups managed by Ansible, in the format of:
# - name: Group name
#   gid: Group ID number
#   state: Group state, defaults to system_group_default_state
  • system_user_default_state: Default state of users. Should be present.
  • system_user_delete_home: Delete home directory on users set to absent.
  • system_group_default_state: Default state of groups. Should be present.
  • system_user_default_shell: Default shell for users managed by Ansible. Defaults to bash.
  • system_sudo_group: Group used by sudo. This is set to sudo on Debian-based distros, and wheel on all other distros.

Dependencies

None.

Example Playbook

Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:

- hosts: all
  roles:
      - base-system
  vars:
    system_users:
      # Creates a user, jdoe, with the uid of 1000, with sudo privileges. 
      - { uid: 1000, name: "jdoe", comment: "John Doe", password_hash: "pw_hash", groups: ["{{system_sudo_group}}"], state: present }
    system_locale: "en_US.UTF-8"
    system_timezone: "America/Chicago"

License

MIT

Author Information

Colin Murphy

ansible-role-baseline's People

Contributors

colinmurphy1 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.