Initial commit
All checks were successful
Ansible Playbook lint / ansible-lint (push) Successful in 35s

This commit is contained in:
2024-12-19 10:25:37 +08:00
commit bf6ac11888
28 changed files with 742 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env -S bash
mapfile -t files <<< "$(ls -1 /tmp/kcw-*.zip)"
for file in ${files[@]}; do
echo "target: $file"
dir=$(cut -d'$' -f1 <<< "$file")
if ! [[ -d "$dir" ]]; then
unzip -d "$dir" "$file"
fi
cmsImportTask "$dir"
done

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env -S bash
cat > contest.yaml <<EOF
name: "con_test"
description: "Contest to test CMS"
users:
EOF
awk '{printf "- username: \"%s\"\n password: \"%s\"\n", $1, $2}' passwd >> contest.yaml
less contest.yaml

View File

@@ -0,0 +1,15 @@
---
- name: Copy users.bash
ansible.builtin.copy:
src: users.bash
dest: /srv/cms/users.bash
mode: '0755'
owner: cmsuser
group: cmsuser
- name: Copy import.bash
ansible.builtin.copy:
src: import.bash
dest: /srv/cms/import.bash
mode: '0755'
owner: cmsuser
group: cmsuser