centos_base

Ansible role centos_base

Basic CentOS Configuration

GitHub Version Issues Pull Requests Downloads
github Version Issues PullRequests Ansible Role

Example Playbook

This example is taken from molecule/default/converge.yml and is tested on each push, pull request and release.

---
# TODO: move this playbook to a different scenario
# Default scenario must work with default variable values
- name: Converge
  hosts: all
  vars:
    - centos_base_utility_packages: true
    - centos_base_enable_epel: true
    - centos_base_vim_users: ['root']
    - centos_base_basic_vim_tweaks: true
    - centos_base_firewalld_services: ['http']
    - centos_base_basic_packages: true
    - centos_base_firewalld: true
    - centos_base_debug_packages: true
    - centos_base_security_packages: true
  pre_tasks:
    - name: intall Apache
      ansible.builtin.yum:
        name: httpd
    - name: start httpd
      ansible.builtin.systemd:
        name: httpd
        state: started
  roles:
    - role: buluma.centos_base

The machine needs to be prepared. In CI this is done using molecule/default/prepare.yml:

---
- name: prepare
  hosts: all
  become: yes
  gather_facts: no

  roles:
    - role: buluma.bootstrap
    - role: buluma.epel

Also see a full explanation and example on how to use these roles.

Role Variables

The default values for the variables are set in defaults/main.yml:

---
# defaults file for centos_base

centos_base_secure_sshd: false
centos_base_basic_vim_tweaks: false
centos_base_htop_configuration: false
centos_base_fail2ban_configuration: false
centos_base_selinux_packages: false
centos_base_firewalld_services: []
centos_base_nagios_packages: false
centos_base_utility_packages: false
centos_base_basic_packages: false
centos_base_debug_packages: false
centos_base_enable_epel: false
centos_base_lockprg: false
centos_base_security_packages: false
centos_base_firewalld: true
centos_base_development_packages: false

Requirements

State of used roles

The following roles are used to prepare a system. You can prepare your system in another way.

Requirement GitHub Version
buluma.bootstrap Ansible Molecule Version
buluma.epel Ansible Molecule Version

Context

This role is a part of many compatible roles. Have a look at the documentation of these roles for further information.

Here is an overview of related roles:

dependencies

Compatibility

This role has been tested on these container images:

container tags
EL 8, 7

The minimum version of Ansible required is 2.10, tests have been done to:

  • The previous version.
  • The current version.
  • The development version.

If you find issues, please register them in GitHub

Changelog

Role History

License

Apache-2.0

Author Information

Shadow Walker

Install
ansible-galaxy install buluma/ansible-role-centos_base
GitHub repository
License
apache-2.0
Downloads
12559
Owner
DevOps Engineer