Initial commit

This commit is contained in:
2026-07-07 10:43:07 -04:00
commit 4dcdc58d73
8 changed files with 320 additions and 0 deletions
+38
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).
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# defaults file for ansible-role-monero
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# handlers file for ansible-role-monero
+35
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.
+229
View File
@@ -0,0 +1,229 @@
#SPDX-License-Identifier: MIT-0
---
# tasks file for ansible-role-monero
- name: Create Monero namespace
k8s:
state: present
definition:
apiVersion: v1
kind: Namespace
metadata:
name: monero
- name: Create PVC for Monero
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
namespace: monero
spec:
storageClassName: r720-nfs-client
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 512Gi
- name: Create PVC for P2Pool
k8s:
state: present
definition:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: p2pool
namespace: monero
spec:
storageClassName: r720-nfs-client
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 64Gi
- name: Request a certificate for Monero
k8s:
state: present
definition:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: monerotls
namespace: monero
spec:
secretName: monerotls
privateKey:
algorithm: RSA
encoding: PKCS1
size: 2048
duration: 2160h # 90d
renewBefore: 360h # 15d
isCA: false
usages:
- server auth
- client auth
subject:
organizations:
- EOM
commonName: monerod.eom.dev
dnsNames:
- monerod.eom.dev
issuerRef:
name: ca-issuer
kind: ClusterIssuer
- name: Request a certificate for p2pool
k8s:
state: present
definition:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: tls
namespace: monero
spec:
secretName: tls
privateKey:
algorithm: RSA
encoding: PKCS1
size: 2048
duration: 2160h # 90d
renewBefore: 360h # 15d
isCA: false
usages:
- server auth
- client auth
subject:
organizations:
- EOM
commonName: p2pool.eom.dev
dnsNames:
- p2pool.eom.dev
issuerRef:
name: ca-issuer
kind: ClusterIssuer
- name: Edit Deployment for Monerod
k8s:
definition:
apiVersion: v1
kind: Deployment
metadata:
name: monerod
namespace: monero
spec:
replicas: 1
selector:
matchLabels:
app: monerod
template:
metadata:
labels:
app: monerod
spec:
containers:
- name: monerod
image: ericomeehan/monerod:latest
imagePullPolicy: Always
command:
- monerod
args:
- "--p2p-bind-ip=0.0.0.0"
- "--p2p-bind-port=18080"
- "--rpc-bind-ip=0.0.0.0"
- "--rpc-bind-port=18081"
- "--restricted-rpc"
- "--rpc-login={{ monerod_user }}:{{ monerod_password }}"
- "--data-dir=/data"
- "--zmq-pub=tcp://127.0.0.1:18083"
- "--rpc-ssl=enabled"
- "--rpc-ssl-private-key=/etc/letsencrypt/tls.key"
- "--rpc-ssl-certificate=/etc/letsencrypt/tls.crt"
- "--non-interactive"
- "--no-igd"
- "--confirm-external-bind"
- "--bootstrap-daemon-address=auto"
resources:
requests:
memory: 2Gi
ports:
- containerPort: 18080
- containerPort: 18081
- containerPort: 18083
volumeMounts:
- name: monerod
mountPath: /data
- name: monerotls
mountPath: /etc/letsencrypt
- name: p2pool
image: ericomeehan/p2pool:latest
imagePullPolicy: IfNotPresent
command:
- p2pool
args:
- "--host"
- "127.0.0.1"
- "--rpc-port"
- "18081"
- "--wallet"
- "{{ monero_p2pool_wallet_address }}"
- "--stratum"
- "0.0.0.0:3333"
- "--p2p"
- "0.0.0.0:37889"
- "--addpeers"
- "65.21.227.114:37889"
- "--tls-cert"
- "/etc/letsencrypt/tls.crt"
- "--tls-cert-key"
- "/etc/letsencrypt/tls.key"
- "--rpc-ssl"
ports:
- containerPort: 3333
- containerPort: 37889
volumeMounts:
- name: p2pool
mountPath: /home/p2pool
- name: tls
mountPath: /etc/letsencrypt
volumes:
- name: monerod
persistentVolumeClaim:
claimName: data
- name: p2pool
persistentVolumeClaim:
claimName: p2pool
- name: monerotls
secret:
secretName: monerotls
- name: tls
secret:
secretName: tls
- name: Create Service for Monero
k8s:
definition:
apiVersion: v1
kind: Service
metadata:
name: monerod
namespace: monero
spec:
selector:
app: monerod
ports:
- port: 18080
name: p2p
- port: 18081
name: rpc
- port: 18083
name: zmq
- port: 3333
name: mine
- port: 37889
name: p2poolp2p
type: LoadBalancer
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
localhost
+6
View File
@@ -0,0 +1,6 @@
#SPDX-License-Identifier: MIT-0
---
- hosts: localhost
remote_user: root
roles:
- ansible-role-monero
+3
View File
@@ -0,0 +1,3 @@
#SPDX-License-Identifier: MIT-0
---
# vars file for ansible-role-monero