Initial commit

This commit is contained in:
Eric Meehan 2026-02-16 00:48:56 -05:00
commit 6cb9d53136
Signed by: eric
GPG Key ID: B7DA729FBB8CA6E9
11 changed files with 447 additions and 0 deletions

38
README.md Normal file
View File

@ -0,0 +1,38 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
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: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).

17
defaults/main.yml Normal file
View File

@ -0,0 +1,17 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for ansible-role-inspircd-hidden
inspircd_admin_desc: "Supreme Overlord"
inspircd_admin_email: "noreply@example.com"
inspircd_admin_name: "Adam Inistrator"
inspircd_connect_password: "changeme"
inspircd_mariadb_password: "changeme"
inspircd_mariadb_root_password: "changeme"
inspircd_namespace: "inspircd-hidden"
inspircd_net_name: "ExampleNet"
inspircd_oper_hash: "hmac-sha256"
inspircd_oper_password_hash: "hmac-sha256"
inspircd_pvc_size_config: "256Mi"
inspircd_pvc_size_data: "8Gi"
inspircd_pvc_size_db: "8Gi"
inspircd_uplink_password: "changeme"

BIN
files/.motd.swp Normal file

Binary file not shown.

17
files/motd Normal file
View File

@ -0,0 +1,17 @@
welcome to anonymous irc
.-",
shhh `~||
||
||
||___
(':.)`
|| ||
|| ||
^^ ^^
wiki: http://62gbfv7k2v7pekye6uxzuh2pnwehzp5xoaeq2ayedvkwpbldae6u62yd.onion
git: http://5mn6xqux6cg3jnnm4ccoib3ps7zz3qiplj2vvjdcnfhfrqssovzngrqd.onion
mail: smtp://alzjyiawrala6kludm5lfq6ik3nk7kitirbddaqisf6xglo5dqtu5oad.onion
archive: http://p5u7bmg6livql563t5b3wnmknrtlgvy77vljeuh3yc4txvuudw274cqd.onion
irc: irc://4afvossiohdpny2z62lpo6r6wqhjqvm3dyklgek2yh4bwb54lvhwzuqd.onion

3
handlers/main.yml Normal file
View File

@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for ansible-role-inspircd-hidden

35
meta/main.yml Normal file
View File

@ -0,0 +1,35 @@
#SPDX-License-Identifier: MIT-0
galaxy_info:
author: your name
description: your role description
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.1
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

BIN
tasks/.main.yml.swp Normal file

Binary file not shown.

325
tasks/main.yml Normal file
View File

@ -0,0 +1,325 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for ansible-role-inspircd
- name: namespace
k8s:
state: present
definition:
apiVersion: v1
kind: Namespace
metadata:
name: "{{ inspircd_namespace }}"
- name: certificate
k8s:
state: present
definition:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: ssl
namespace: "{{ inspircd_namespace }}"
spec:
secretName: ssl
privateKey:
algorithm: RSA
encoding: PKCS1
size: 2048
duration: 2160h # 90d
renewBefore: 360h # 15d
isCA: false
usages:
- server auth
- client auth
subject:
organizations:
- EOM
commonName: inspircd.eom.dev
dnsNames:
- inspircd.eom.dev
issuerRef:
name: ca-issuer
kind: ClusterIssuer
- name: configmap for motd
k8s:
state: present
definition:
apiVersion: v1
kind: ConfigMap
metadata:
name: motd
namespace: "{{ inspircd_namespace }}"
data:
docker.motd: "{{ lookup('file', 'motd') }}"
- name: pvc for config
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: config
namespace: "{{ inspircd_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ inspircd_pvc_size_config }}"
- name: pvc for data
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
namespace: "{{ inspircd_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ inspircd_pvc_size_data }}"
- name: pvc for db
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: db
namespace: "{{ inspircd_namespace }}"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "{{ inspircd_pvc_size_db }}"
- name: deployment for mariadb
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: mariadb
namespace: "{{ inspircd_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: mariadb
template:
metadata:
labels:
app: mariadb
spec:
containers:
- name: mariadb
image: mariadb
env:
- name: MYSQL_ROOT_PASSWORD
value: "{{ inspircd_mariadb_root_password }}"
- name: MYSQL_USER
value: "anope"
- name: MYSQL_PASSWORD
value: "{{ inspircd_mariadb_password }}"
- name: MYSQL_DATABASE
value: "anope"
volumeMounts:
- name: db
mountPath: /var/lib/mysql
ports:
- containerPort: 3306
volumes:
- name: db
persistentVolumeClaim:
claimName: db
- name: service for mariadb
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: mariadb
namespace: "{{ inspircd_namespace }}"
spec:
selector:
app: mariadb
ports:
- port: 3306
name: mariadb
type: ClusterIP
- name: deployment for anope
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: anope
namespace: "{{ inspircd_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: anope
template:
metadata:
labels:
app: anope
spec:
containers:
- name: anope
image: anope/anope
env:
- name: ANOPE_SERVICES_NAME
value: "{{ inspircd_services_name }}"
- name: ANOPE_SERVICES_VHOST
value: "{{ inspircd_services_vhost }}"
- name: ANOPE_UPLINK_IP
value: "inspircd"
- name: ANOPE_UPLINK_PASSWORD
value: "{{ inspircd_uplink_password }}"
- name: ANOPE_SQL_ENGINE
value: "mysql"
- name: ANOPE_MYSQL_HOST
value: "mariadb"
- name: ANOPE_MYSQL_PASSWORD
value: "{{ inspircd_mariadb_password }}"
ports:
- containerPort: 7000
- name: service for anope
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: anope
namespace: "{{ inspircd_namespace }}"
spec:
selector:
app: anope
ports:
- port: 7000
name: anope
type: ClusterIP
- name: deployment for inspircd
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: inspircd
namespace: "{{ inspircd_namespace }}"
spec:
replicas: 1
selector:
matchLabels:
app: inspircd
template:
metadata:
labels:
app: inspircd
spec:
containers:
- name: inspircd
image: inspircd/inspircd-docker
command:
- "/bin/bash"
args:
- "-c 'cp /etc/letsencrypt/tls.crt /inspircd/conf/cert.pem && cp /etc/letsencrypt/tls.key /inspircd/conf/key.pem && /entrypoint.sh'"
env:
- name: INSP_NET_SUFFIX
value: "{{ inspircd_net_suffix }}"
- name: INSP_NET_NAME
value: "{{ inspircd_net_name }}"
- name: INSP_SERVER_NAME
value: "{{ inspircd_server_name }}"
- name: INSP_ADMIN_NAME
value: "{{ inspircd_admin_name }}"
- name: INSP_ADMIN_DESC
value: "{{ inspircd_admin_desc }}"
- name: INSP_ADMIN_EMAIL
value: "{{ inspircd_admin_email }}"
- name: INSP_CONNECT_PASSWORD
value: "{{ inspircd_connect_password }}"
- name: INSP_OPER_HASH
value: "{{ inspircd_oper_hash }}"
- name: INSP_OPER_PASSWORD_HASH
value: "{{ inspircd_oper_password_hash }}"
- name: INSP_SERVICES_NAME
value: "{{ inspircd_services_name }}"
- name: INSP_SERVICES_IPADDR
value: "anope"
- name: INSP_SERVICES_PASSWORD
value: "{{ inspircd_uplink_password }}"
volumeMounts:
- name: config
mountPath: /inspircd/conf.d
- name: data
mountPath: /inspircd/data
- name: motd
mountPath: /inspircd/conf/docker.motd
subPath: docker.motd
- name: ssl
mountPath: /etc/
ports:
- containerPort: 6667
volumes:
- name: data
persistentVolumeClaim:
claimName: data
- name: config
persistentVolumeClaim:
claimName: config
- name: motd
configMap:
name: motd
- name: ssl
secret:
secretName: ssl
- name: service for inspircd
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: inspircd
namespace: "{{ inspircd_namespace }}"
spec:
selector:
app: inspircd
ports:
- port: 6667
name: irc
type: ClusterIP
- name: onionservice
k8s:
definition:
apiVersion: tor.k8s.torproject.org/v1alpha2
kind: OnionService
metadata:
name: inspircd
namespace: "{{ inspircd_namespace }}"
spec:
version: 3
rules:
- port:
number: 6667
backend:
service:
name: inspircd
port:
number: 6667

3
tests/inventory Normal file
View File

@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
localhost

6
tests/test.yml Normal file
View File

@ -0,0 +1,6 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-inspircd-hidden

3
vars/main.yml Normal file
View File

@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for ansible-role-inspircd-hidden