commit 6cb9d53136163bfdfc9e21b638379e619a7f3b65 Author: Eric Meehan Date: Mon Feb 16 00:48:56 2026 -0500 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/README.md @@ -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). diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..c91795c --- /dev/null +++ b/defaults/main.yml @@ -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" diff --git a/files/.motd.swp b/files/.motd.swp new file mode 100644 index 0000000..e029b02 Binary files /dev/null and b/files/.motd.swp differ diff --git a/files/motd b/files/motd new file mode 100644 index 0000000..17bac1b --- /dev/null +++ b/files/motd @@ -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 diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..bfe985d --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# handlers file for ansible-role-inspircd-hidden diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..36b9858 --- /dev/null +++ b/meta/main.yml @@ -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. diff --git a/tasks/.main.yml.swp b/tasks/.main.yml.swp new file mode 100644 index 0000000..3182813 Binary files /dev/null and b/tasks/.main.yml.swp differ diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..8300c60 --- /dev/null +++ b/tasks/main.yml @@ -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 + diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..03ca42f --- /dev/null +++ b/tests/inventory @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..8ac829b --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,6 @@ +#SPDX-License-Identifier: MIT-0 +--- +- hosts: localhost + remote_user: root + roles: + - ansible-role-inspircd-hidden diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..121ae89 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# vars file for ansible-role-inspircd-hidden