mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-17 09:14:25 +00:00
Added cloud-init example for boinc-client, improved the one for docker
This commit is contained in:
42
examples/cloud-init/boinc-client.yum.yaml
Normal file
42
examples/cloud-init/boinc-client.yum.yaml
Normal file
@@ -0,0 +1,42 @@
|
||||
#cloud-config
|
||||
|
||||
yum_repos:
|
||||
epel:
|
||||
name: Extra Packages for Enterprise Linux 8 - $basearch
|
||||
baseurl: https://dl.fedoraproject.org/pub/epel/8/Everything/$basearch
|
||||
gpgcheck: true
|
||||
gpgkey: https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
|
||||
|
||||
packages:
|
||||
- boinc-client
|
||||
- boinc-tui
|
||||
|
||||
bootcmd:
|
||||
# `cloud-init` has issues with `firewall-cmd`.
|
||||
# Using the offline version.
|
||||
- firewall-offline-cmd --add-port='31416/tcp' --zone='public'
|
||||
|
||||
runcmd:
|
||||
- grep -q 'boinc' '/etc/group' && sudo usermod -a -G 'boinc' 'opc'
|
||||
- chown -R 'boinc:boinc' '/var/lib/boinc'
|
||||
- systemctl enable --now 'boinc-client.service'
|
||||
- sleep '5s'
|
||||
- boinccmd --acct_mgr attach 'acct_mgr_url' 'acct_mgr_user' 'acct_mgr_password'
|
||||
- systemctl reload 'firewalld.service'
|
||||
|
||||
write_files:
|
||||
- path: /var/lib/boinc/gui_rpc_auth.cfg
|
||||
permissions: '0640'
|
||||
content: |
|
||||
gui_rpc_password
|
||||
- path: /var/lib/boinc/cc_config.xml
|
||||
content: |
|
||||
<cc_config>
|
||||
<options>
|
||||
<allow_remote_gui_rpc>1</allow_remote_gui_rpc>
|
||||
</options>
|
||||
</cc_config>
|
||||
- path: /var/lib/boinc/remote_hosts.cfg
|
||||
content: |
|
||||
192.168.1.10
|
||||
192.168.1.115
|
||||
@@ -6,23 +6,19 @@
|
||||
# Add the official Docker repository.
|
||||
#
|
||||
# Got from the official installation guide at
|
||||
# https://docs.docker.com/engine/install/rhel/#install-using-the-repository :
|
||||
# yum install -y yum-utils && \
|
||||
# yum-config-manager --add-repo \
|
||||
# https://download.docker.com/linux/rhel/docker-ce.repo && \
|
||||
# cat /etc/yum.repos.d/docker-ce.repo
|
||||
# https://docs.docker.com/engine/install/
|
||||
#
|
||||
# Sources:
|
||||
# - https://cloudinit.readthedocs.io/en/latest/topics/modules.html#yum-add-repo
|
||||
# - https://cloudinit.readthedocs.io/en/latest/topics/examples.html#adding-a-yum-repository
|
||||
yum_repos:
|
||||
docker-ce:
|
||||
docker-ce-stable:
|
||||
name: Docker CE Stable - $basearch
|
||||
enabled: true
|
||||
baseurl: https://download.docker.com/linux/rhel/$releasever/$basearch/stable
|
||||
baseurl: https://download.docker.com/linux/centos/$releasever/$basearch/stable
|
||||
priority: 1
|
||||
gpgcheck: true
|
||||
gpgkey: https://download.docker.com/linux/rhel/gpg
|
||||
gpgkey: https://download.docker.com/linux/centos/gpg
|
||||
|
||||
# Install required packages.
|
||||
# This will *always* update the list of packages, regardless of the value of the
|
||||
@@ -35,8 +31,12 @@ yum_repos:
|
||||
# - https://cloudinit.readthedocs.io/en/latest/topics/examples.html#install-arbitrary-packages
|
||||
packages:
|
||||
- docker-ce
|
||||
- docker-compose-plugin
|
||||
|
||||
# Enable and start the service after installation
|
||||
runcmd:
|
||||
# Enable and start the service after installation.
|
||||
- systemctl daemon-reload
|
||||
- systemctl enable --now docker.service
|
||||
|
||||
# Give the default user permission to use docker without privilege escalation.
|
||||
- grep docker /etc/group -q && sudo usermod -a -G docker user
|
||||
|
||||
Reference in New Issue
Block a user