Coder Social home page Coder Social logo

while-true-do / ansible-role-srv_cockpit Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 1.0 52 KB

An Ansible Role to install and configure Cockpit.

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%
ansible ansible-role centos fedora redhat cockpit monitoring cockpit-project operation administration system web

ansible-role-srv_cockpit's Introduction

Github (tag) Github (license) Github (issues) Github (pull requests)

Travis (com)

Ansible (min. version) Ansible (platforms) Ansible (tags)

Ansible Role: srv_cockpit

An Ansible role to install and configure Cockpit.

Motivation

Cockpit ia a very interesting management tool for Linux servers. It does provide an overview of different metrics and allows management for several features. It does integrate with tools like docker, selinux, kdump, podman or kvm.

Description

This role installs and configures several features and modules of cockpit.

  • cockpit system
  • cockpit web
  • integration for docker
  • integration for libvirt
  • integration for performance co-pilot
  • integration for podman
  • configure the dashboard
  • configure firewalld

Requirements

There are no hard requirements. Nevertheless, since cockpit integrates with lots of services, you should review some of these tools and optional roles.

Optional Roles:

Used Modules:

Installation

Install from Ansible Galaxy

ansible-galaxy install while_true_do.srv_cockpit

Install from Github

git clone https://github.com/while-true-do/ansible-role-srv_cockpit.git while_true_do.srv_cockpit

Dependencies:

If you want to install all optional roles, run the below command.

ansible-galaxy install -r requirements.yml

Usage

Role Variables

---
# defaults file for while_true_do.srv_cockpit

## Package Management
# Defaults are based on Fedora Linux

# Cockpit System Packages
# Most likely needed for all systems
# You should consider to have a look at:
# - while_true_do.sys_kdump
# - while_true_do.sys_selinux
# - while_true_do.sys_tuned
wtd_srv_cockpit_sys_package:
  - cockpit-networkmanager
  - cockpit-storaged
  - cockpit-sosreport
  - cockpit-system
  - cockpit-kdump
  - cockpit-selinux
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_sys_package_state: "present"

# Cockpit Packagekit Integration
wtd_srv_cockpit_pk_package:
  - cockpit-packagekit
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_pk_package_state: "present"

# Cockpit PCP Integration
# You should consider to look at while_true_do.sys_pcp
wtd_srv_cockpit_pcp_package:
  - cockpit-pcp
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_pcp_package_state: "present"

# Cockpit Docker Integration
# You should consider to look at while_true_do.srv_docker
wtd_srv_cockpit_docker_package:
  - cockpit-docker
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_docker_package_state: "absent"

# Cockpit Podman Integration
# You should consider to look at while_true_do.srv_podman
wtd_srv_cockpit_podman_package:
  - cockpit-podman
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_podman_package_state: "absent"

# Cockpit libvirt Integration
# You should consider to look at while_true_do.srv_kvm
wtd_srv_cockpit_machines_package:
  - cockpit-machines
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_machines_package_state: "absent"

## Cockpit Web Management
# Only needed, if you want to access the server directly via web ui

# Cockpit Web Package Management
wtd_srv_cockpit_web_package:
  - cockpit
  - cockpit-ws
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_web_package_state: "absent"

# Cockpit Web Dashboard for multiple servers
wtd_srv_cockpit_web_dash_package:
  - cockpit-dashboard
# State can be present|latest|absent|unmanaged
wtd_srv_cockpit_web_dash_package_state: "absent"

## Cockpit Web Service Management
wtd_srv_cockpit_web_service: "cockpit.socket"
# State can be started|stopped
wtd_srv_cockpit_web_service_state: "started"
wtd_srv_cockpit_web_service_enabled: true

## Cockpit Web Firewalld Management
wtd_srv_cockpit_web_fw_mgmt: true
wtd_srv_cockpit_web_fw_service: "cockpit"
# State can be enabled|disabled
wtd_srv_cockpit_web_fw_service_state: "enabled"
# Zone can be according to defined zones on your machine.
wtd_srv_cockpit_web_fw_service_zone: "public"

## Cockpit Web Configuration Management
# See here: http://cockpit-project.org/guide/latest/cockpit.conf.5.html
wtd_srv_cockpit_web_conf_Origins: ""
wtd_srv_cockpit_web_conf_ProtocolHeader: ""
wtd_srv_cockpit_web_conf_LoginTo: ""
wtd_srv_cockpit_web_conf_LoginTitle: ""
wtd_srv_cockpit_web_conf_RequireHost: ""
wtd_srv_cockpit_web_conf_MaxStartups: "3"
wtd_srv_cockpit_web_conf_AllowUnencrypted: ""
wtd_srv_cockpit_web_conf_UrlRoot: ""
# See here: http://cockpit-project.org/guide/latest/cockpit-ws.8.html
wtd_srv_cockpit_web_conf_cert: ""

# wtd_srv_cockpit_web_conf_clients:
#   - name: "host1.example.com"   # ip|fqdn
#     color: "rgb(0, 0, 255)"     # defaults to random color
#     port: "22"                  # defaults to 22

Example Playbook

Running Ansible Roles can be done in a playbook.

Simple

---
- hosts: all
  roles:
    - role: while_true_do.srv_cockpit

Host with web interface and dashboard

- hosts: all
  roles:
    - role: while_true_do.srv_cockpit
      wtd_srv_cockpit_web_package_state: "present"
      wtd_srv_cockpit_web_dash_package_state: "present"

Add multiple Clients to the Dashboard

- hosts: all
  roles:
    - role: while_true_do.srv_cockpit
      wtd_srv_cockpit_web_package_state: "present"
      wtd_srv_cockpit_web_dash_package_state: "present"
      wtd_srv_cockpit_web_conf_clients:
        - name: "host1"
          address: "host1.example.com"
        - name: "host2"
          address: "host2.example.com"
        - name: "host3"
          address: "192.168.22.10"

Known Issues

  1. RedHat Testing is currently not possible in public, due to limitations in subscriptions.
  2. Some services and features cannot be tested properly, due to limitations in docker.

Testing

Most of the "generic" tests are located in the Test Library.

Ansible specific testing is done with Molecule.

Infrastructure testing is done with testinfra.

Automated testing is done with Travis CI.

Contribute

Thank you so much for considering to contribute. We are very happy, when somebody is joining the hard work. Please fell free to open Bugs, Feature Requests or Pull Requests after reading the Contribution Guideline.

See who has contributed already in the kudos.txt.

License

This work is licensed under a BSD-3-Clause License.

Contact

ansible-role-srv_cockpit's People

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

coding-to-music

ansible-role-srv_cockpit's Issues

Feature: cockpit-tls support

With cockpit v200, the cockpit-tls proxy was released.
Currently it does not have many features, but will improve over time. We should consider putting it in the role.

Feature: Reduce complexity (roles conflicting heavy)

The role feature is currently conflicting and will do this more, when starting support for debian et all. Therefore, we should remove the role feature and focus on proper distribution support.

Defaults for package states would help a lot and can be overwritten by the "var" include, if not present in repositories.

Feature: podman support

With Fedora30 the cockpit podman plugin is supported and should be included as a new role.

Feature: 389 support

As an Operator, I want to use 389 directory server and have a first management entry point in cockpit.

Bug: 99-webui.json overwritten

The 99-webui.json is overwritten with each run, even if no host is defined. A switch to initiate/update or handling of non-existing variables would be great. Currently the dashboard is "reset" with every run.

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.