migrate to git.charlotte.sh
This commit is contained in:
commit
fbd588721e
412 changed files with 13750 additions and 0 deletions
2
sysadmin-ii-sys265/configs/controller/ansible/roles/semuadmin.webmin/.gitignore
vendored
Normal file
2
sysadmin-ii-sys265/configs/controller/ansible/roles/semuadmin.webmin/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
.DS_Store
|
||||
.dropbox
|
|
@ -0,0 +1,26 @@
|
|||
BSD 3-Clause License ("BSD License 2.0", "Revised BSD License", "New BSD License", or "Modified BSD License")
|
||||
|
||||
Copyright (c) 2019, SEMU Consulting
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the <organization> nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,66 @@
|
|||
Role Name
|
||||
=========
|
||||
|
||||
## THIS REPO IS NO LONGER BEING ACTIVELY MAINTAINED OR SUPPORTED.
|
||||
|
||||
### IF ANYONE ELSE WANTS TO TAKE ON THE MAINTENANCE AND SUPPORT, FEEL FREE TO FORK IT.
|
||||
|
||||
[Ansible role](https://galaxy.ansible.com/semuadmin/webmin) to deploy Webmin web-based linux administration utility, running as a
|
||||
systemd service.
|
||||
|
||||
Webmin service will be available on https://hostip:10000.
|
||||
|
||||
Default login will be the userid and password of the installer user.
|
||||
|
||||
You may get a browser warning about Webmin's default self-sign SSL certificate.
|
||||
|
||||
System will reboot after installation.
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
- Installation requires sudo privileges.
|
||||
- Systemd for services control.
|
||||
- Firewalld for firewall control (if required).
|
||||
- Python for Ansible provisioning (note that some minimal distributions do not include python out of the box).
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
- `install_utilities`: false. Set to True to install various utility packages used by Webmin management functions (wget, git, ntpdate, sntp, smartmontools).
|
||||
Note that some minimal distributions do not support all these tools out of the box and may require interactive installation.
|
||||
|
||||
- `enable_firewalld`: false. Set to True to open port 10000 via firewalld (assumes firewalld is installed and running).
|
||||
|
||||
- `uninstall_webmin` : false. Set to true to uninstall Webmin.
|
||||
|
||||
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:
|
||||
|
||||
```yaml
|
||||
|
||||
- name: Provision webmin role
|
||||
hosts: all
|
||||
become: true
|
||||
become_user: root
|
||||
|
||||
vars:
|
||||
enable_firewalld: true
|
||||
install_utilities: true
|
||||
|
||||
roles:
|
||||
- semuadmin.webmin
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
BSD 3-Clause
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
# defaults file for webmin
|
||||
|
||||
webmin_dir: /etc/webmin
|
||||
webmin_yum_repo: "http://download.webmin.com/download/yum"
|
||||
webmin_mirrorlist: "http://download.webmin.com/download/yum/mirrorlist"
|
||||
webmin_gpgkey: "http://www.webmin.com/jcameron-key.asc"
|
||||
|
||||
webmin_apt_repo: "deb [signed-by=/etc/apt/trusted.gpg.d/jcameron-key.asc] https://download.webmin.com/download/repository sarge contrib"
|
||||
|
||||
enable_firewalld: false
|
||||
install_utilities: false
|
||||
uninstall_webmin: false
|
||||
|
||||
webmin_disable_reboot: false
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
# handlers file for webmin
|
||||
|
||||
- name: Restart webmin
|
||||
ansible.builtin.systemd:
|
||||
name: webmin
|
||||
state: restarted
|
|
@ -0,0 +1,2 @@
|
|||
install_date: Sat Feb 22 17:36:07 2025
|
||||
version: v1.0.9
|
|
@ -0,0 +1,29 @@
|
|||
galaxy_info:
|
||||
role_name: webmin
|
||||
author: semu
|
||||
description: webmin role
|
||||
company: SEMU Consulting
|
||||
|
||||
license: BSD 3-Clause
|
||||
|
||||
min_ansible_version: "7"
|
||||
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- "9"
|
||||
- "8"
|
||||
- "7"
|
||||
- name: Fedora
|
||||
versions:
|
||||
- "36"
|
||||
- name: Debian
|
||||
versions:
|
||||
- bullseye
|
||||
- name: Ubuntu
|
||||
versions:
|
||||
- focal
|
||||
- bionic
|
||||
- jammy
|
||||
galaxy_tags:
|
||||
- webmin
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
# tasks file for webmin #
|
||||
|
||||
- name: Install webmin
|
||||
ansible.builtin.include_tasks: webmin.yml
|
||||
when: not uninstall_webmin
|
||||
|
||||
- name: Uninstall webmin
|
||||
ansible.builtin.include_tasks: uninstall.yml
|
||||
when: uninstall_webmin
|
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
# tasks file for uninstall webmin #
|
||||
|
||||
- name: Remove Webmin files and directories
|
||||
ansible.builtin.file:
|
||||
path: "/etc/webmin"
|
||||
state: absent
|
||||
|
||||
- name: Disable firewalld service.
|
||||
ansible.posix.firewalld:
|
||||
zone: public
|
||||
service: webmin
|
||||
permanent: true
|
||||
state: disabled
|
||||
immediate: true
|
||||
when: enable_firewalld
|
||||
|
||||
- name: Remove yum repository for Redhat platforms
|
||||
ansible.builtin.yum_repository:
|
||||
name: webmin
|
||||
description: Webmin yum repo
|
||||
baseurl: "{{ webmin_yum_repo }}"
|
||||
mirrorlist: "{{ webmin_mirrorlist }}"
|
||||
state: absent
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Remove apt repository for Debian platforms
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "{{ webmin_apt_repo }}"
|
||||
state: absent
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Unnstall supporting packages if added
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- wget
|
||||
- git
|
||||
- ntpdate
|
||||
- sntp
|
||||
- smartmontools
|
||||
state: absent
|
||||
when: install_utilities
|
|
@ -0,0 +1,94 @@
|
|||
---
|
||||
# tasks file for webmin#
|
||||
|
||||
- name: Install firewalld service template.
|
||||
ansible.builtin.template:
|
||||
src: webmin.xml.j2
|
||||
dest: "/etc/firewalld/services/webmin.xml"
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
when: enable_firewalld
|
||||
|
||||
- name: Reload firewalld to register new service.
|
||||
ansible.builtin.command: firewall-cmd --reload
|
||||
register: firewall
|
||||
changed_when: "'success' in firewall.stdout"
|
||||
when: enable_firewalld
|
||||
|
||||
- name: Enable firewalld service.
|
||||
ansible.posix.firewalld:
|
||||
zone: public
|
||||
service: webmin
|
||||
permanent: true
|
||||
state: enabled
|
||||
immediate: true
|
||||
when: enable_firewalld
|
||||
|
||||
- name: Add yum repository and gpg key for Redhat platforms.
|
||||
ansible.builtin.yum_repository:
|
||||
name: webmin
|
||||
description: Webmin yum repo
|
||||
baseurl: "{{ webmin_yum_repo }}"
|
||||
mirrorlist: "{{ webmin_mirrorlist }}"
|
||||
gpgkey: "{{ webmin_gpgkey }}"
|
||||
gpgcheck: true
|
||||
state: present
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: Add a gpg key for Debian platforms.
|
||||
ansible.builtin.get_url:
|
||||
url: "{{ webmin_gpgkey }}"
|
||||
dest: /etc/apt/trusted.gpg.d/jcameron-key.asc
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Add apt repository for Debian platforms.
|
||||
ansible.builtin.apt_repository:
|
||||
repo: "{{ webmin_apt_repo }}"
|
||||
state: present
|
||||
update_cache: true
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Install https transport for Debian platforms.
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- apt-transport-https
|
||||
state: present
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- name: Install Webmin.
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- webmin
|
||||
state: present
|
||||
|
||||
- name: Install supporting packages if required.
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- wget
|
||||
- git
|
||||
- ntpdate
|
||||
- sntp
|
||||
- smartmontools
|
||||
state: present
|
||||
when: install_utilities
|
||||
|
||||
- name: Remove old systemd service.
|
||||
ansible.builtin.file:
|
||||
path: /etc/systemd/system/webmin.service
|
||||
state: absent
|
||||
|
||||
- name: Enable webmin as systemd service.
|
||||
ansible.builtin.systemd:
|
||||
state: started
|
||||
enabled: true
|
||||
daemon_reload: true
|
||||
name: webmin
|
||||
|
||||
- name: Reboot machine.
|
||||
ansible.builtin.reboot:
|
||||
reboot_timeout: 3600
|
||||
when: not webmin_disable_reboot
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<service>
|
||||
<short>webmin</short>
|
||||
<description>Webmin Web Based Administration</description>
|
||||
<port port="10000" protocol="tcp"/>
|
||||
</service>
|
|
@ -0,0 +1,2 @@
|
|||
localhost
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
- name: Test webmin role
|
||||
hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- webmin
|
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
# vars file for webmin
|
Loading…
Add table
Add a link
Reference in a new issue