Skip to content

Commit

Permalink
Merge pull request #1104 from proditis/playbook-fixes
Browse files Browse the repository at this point in the history
Playbook fixes
  • Loading branch information
proditis authored Feb 19, 2024
2 parents 8865b29 + 1b37d89 commit 67ada0c
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 13 deletions.
1 change: 1 addition & 0 deletions ansible/runonce/db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
packages:
- curl
- git
- rsync--
- mariadb-server
- memcached--
- libmemcached
Expand Down
10 changes: 7 additions & 3 deletions ansible/runonce/docker-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- name: "Setup docker registry on an OpenBSD server (standalone)"
hosts: all
become_method: doas
gather_facts: no
vars_prompt:
- name: "registry_user"
prompt: "1/5. User to run the registry as?"
Expand Down Expand Up @@ -37,14 +38,17 @@
rcctl:
- { name: 'supervisord', state: "enable" }
packages:
- ansible
- go
- supervisor
- py3-setuptools
- git
- rsync--

tasks:
- name: Install packages
openbsd_pkg:
name: "{{packages}}"
raw: pkg_add {{item}}
with_items: "{{packages}}"

- name: Add users
user:
Expand Down Expand Up @@ -95,7 +99,7 @@

- name: Configure supervisor registry service
community.general.ini_file:
path: /etc/conf
path: /etc/supervisord.d/registry.ini
section: "program:registry"
option: "{{item.key}}"
value: "{{item.value}}"
Expand Down
13 changes: 7 additions & 6 deletions ansible/runonce/docker-servers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@

- name: Configure resolv.conf
copy:
content: "nameserver 10.0.0.254\n"
content: "{{resolvconf}}\n"
dest: /etc/resolv.conf
when: resolvconf is defined

- name: Allow release-info to change for APT repositories
when: ansible_facts['distribution'] == 'Debian'
Expand Down Expand Up @@ -120,11 +121,11 @@
pkg: "{{post_apt}}"
when: post_apt is defined and post_apt|length > 0

- name: Install pip packages
no_log: "{{DEBUG|default(true)}}"
pip: name="{{item.name}}" version="{{item.version|default(omit)}}" state="{{item.state}}"
with_items: "{{pip}}"
when: pip is defined
# - name: Install pip packages
# no_log: "{{DEBUG|default(true)}}"
# pip: name="{{item.name}}" version="{{item.version|default(omit)}}" state="{{item.state}}"
# with_items: "{{pip}}"
# when: pip is defined

- name: Check if we're working with cloud-init
ansible.builtin.stat:
Expand Down
3 changes: 2 additions & 1 deletion ansible/runonce/mui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
packages:
- curl
- git
- rsync--
- memcached--
- libmemcached
- py3-mysqlclient
Expand Down Expand Up @@ -298,7 +299,7 @@

- name: "Create moderatorUI config/db.php"
copy:
content: "<?php return [ 'class' => 'yii\\db\\Connection', 'dsn' => 'mysql:host={{db_ip}};dbname=echoCTF', 'username' => 'moderatorUI', 'password' => 'moderatorUI', 'charset' => 'utf8'];\n"
content: "<?php return [ 'class' => 'yii\\db\\Connection', 'dsn' => 'mysql:host={{db_ip}};dbname=echoCTF', 'username' => 'moderatorUI', 'password' => 'moderatorUI', 'charset' => 'utf8mb4'];\n"
dest: "/home/moderatorUI/{{domain_name}}/backend/config/db.php"
mode: '0444'
tags:
Expand Down
6 changes: 6 additions & 0 deletions ansible/runonce/pui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
- automake%1.16
- curl
- git
- rsync--
- libmemcached
- libtool
- memcached--
Expand Down Expand Up @@ -418,6 +419,11 @@
- { section: Session, option: "session.save_path", value: "{{db_ip}}:11211"}
- { section: Session, option: "session.gc_maxlifetime", value: "43200" }
- { section: Session, option: "session.use_strict_mode", value: "1" }
- { section: opcache, option: "opcache.enable", value: "1" }
- { section: opcache, option: "opcache.memory_consumption", value: "128" }
- { section: opcache, option: "opcache.validate_timestamps", value: "0" }
- { section: opcache, option: "opcache.revalidate_freq", value: "2" }
- { section: opcache, option: "opcache.revalidate_path", value: "0" }

- name: copy nginx rc.d into participant
command: cp /etc/rc.d/nginx "/etc/rc.d/{{item}}"
Expand Down
2 changes: 2 additions & 0 deletions ansible/runonce/vpngw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- automake%1.16
- curl
- git
- rsync--
- libmemcached
- memcached--
- libtool
Expand All @@ -67,6 +68,7 @@
- go
- p5-Net-Pcap
- p5-NetPacket
- gnuwatch
vars_prompt:
- name: "myname"
prompt: "1/16. System hostname?"
Expand Down
6 changes: 4 additions & 2 deletions ansible/templates/docker-server-advanced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,14 @@ pre_apt:
- gnupg2
- software-properties-common
- rdate
- python3-requests
- python3-docker

post_apt:
- docker-ce

pip:
- { name: "docker", version: "*", state: "present" }
#pip:
# - { name: "docker", version: "*", state: "present" }

#sync:
# - { src: "../files/docker/build", dst: "/opt" }
2 changes: 1 addition & 1 deletion ansible/templates/unbound.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface: {{bind.ip}}
access-control: 0.0.0.0/0 allow

do-ip6: no
pidfile: "/var/unbound/var/run/unbound.pid"
pidfile: "/var/run/unbound.pid"
hide-identity: yes
hide-version: yes

Expand Down

0 comments on commit 67ada0c

Please sign in to comment.