Add the indexer configuration for new fedora-packages nodes.
This commit is contained in:
parent
f0e82d53af
commit
f8fb27b666
10 changed files with 89 additions and 0 deletions
|
@ -11,3 +11,5 @@ ks_repo: http://10.5.126.23/repo/rhel/RHEL6-x86_64/
|
|||
volgroup: /dev/vg_virthost01
|
||||
vmhost: virthost01.phx2.fedoraproject.org
|
||||
datacenter: phx2
|
||||
|
||||
install_packages_indexer: True
|
||||
|
|
|
@ -11,3 +11,5 @@ ks_repo: http://10.5.126.23/repo/rhel/RHEL6-x86_64/
|
|||
volgroup: /dev/vg_guests
|
||||
vmhost: virthost12.phx2.fedoraproject.org
|
||||
datacenter: phx2
|
||||
|
||||
install_packages_indexer: True
|
||||
|
|
|
@ -11,3 +11,5 @@ ks_repo: http://10.5.126.23/repo/rhel/RHEL6-x86_64/
|
|||
volgroup: /dev/vg_virthost03
|
||||
vmhost: virthost03.phx2.fedoraproject.org
|
||||
datacenter: phx2
|
||||
|
||||
install_packages_indexer: False
|
||||
|
|
1
roles/packages/files/cron-flush-pkgs-cache
Normal file
1
roles/packages/files/cron-flush-pkgs-cache
Normal file
|
@ -0,0 +1 @@
|
|||
0 2 * * * apache /usr/bin/find /var/cache/fedoracommunity/git.fedoraproject.org -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \; >> /var/log/fedoracommunity/cron-flush-pkgs-cache.log 2>&1
|
1
roles/packages/files/cron-sync-latest-builds
Normal file
1
roles/packages/files/cron-sync-latest-builds
Normal file
|
@ -0,0 +1 @@
|
|||
*/15 * * * * apache /usr/bin/fcomm-index-latest-builds -p /var/cache/fedoracommunity/packages/xapian --koji-url http://koji.fedoraproject.org/kojihub >> /var/log/fedoracommunity/cron-sync-latest-builds.log 2>&1
|
2
roles/packages/files/cron-sync-package-index
Normal file
2
roles/packages/files/cron-sync-package-index
Normal file
|
@ -0,0 +1,2 @@
|
|||
0 0 * * * apache /usr/bin/fcomm-index-packages -p /var/cache/fedoracommunity/packages/tmp -y /etc/fedoracommunity/yum-repo.conf --index-db-dest /var/cache/fedoracommunity/packages/xapian --icons-dest /var/cache/fedoracommunity/packages/icons --tagger-url https://apps.fedoraproject.org/tagger/api/v1/tag/export/ --pkgdb-url https://admin.fedoraproject.org/pkgdb >> /var/log/fedoracommunity/cron-sync-package-index.log 2>&1
|
||||
|
1
roles/packages/files/cron-sync-yum
Normal file
1
roles/packages/files/cron-sync-yum
Normal file
|
@ -0,0 +1 @@
|
|||
*/15 * * * * apache /usr/local/bin/sync-yum >> /var/log/fedoracommunity/cron-sync-yum.log 2>&1
|
24
roles/packages/files/cron_fcomm_log_rotate
Normal file
24
roles/packages/files/cron_fcomm_log_rotate
Normal file
|
@ -0,0 +1,24 @@
|
|||
/var/log/fedoracommunity/cron-sync-latest-builds.log {
|
||||
missingok
|
||||
notifempty
|
||||
rotate 4
|
||||
weekly
|
||||
}
|
||||
/var/log/fedoracommunity/cron-sync-package-builds.log {
|
||||
missingok
|
||||
notifempty
|
||||
rotate 4
|
||||
weekly
|
||||
}
|
||||
/var/log/fedoracommunity/cron-sync-yum.log {
|
||||
missingok
|
||||
notifempty
|
||||
rotate 4
|
||||
weekly
|
||||
}
|
||||
/var/log/fedoracommunity/cron-flush-pkgs-cache.log {
|
||||
missingok
|
||||
notifempty
|
||||
rotate 4
|
||||
weekly
|
||||
}
|
34
roles/packages/files/sync-yum
Normal file
34
roles/packages/files/sync-yum
Normal file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOCKFILE=/var/cache/fedoracommunity/fedora-packages-yum.lock
|
||||
|
||||
rebuild=$(cat <<"EOF"
|
||||
echo 'Trying makecache.'
|
||||
/usr/bin/yum makecache -c /etc/fedoracommunity/yum-repo.conf --enablerepo=*
|
||||
echo 'Releasing $LOCKFILE'
|
||||
EOF
|
||||
)
|
||||
nuke_and_rebuild=$(cat <<"EOF"
|
||||
echo 'Nuking.'
|
||||
rm /var/cache/fedoracommunity/packages/tmp/var/lib/rpm/__db.*
|
||||
/usr/bin/rpmdb --root=/var/cache/fedoracommunity/packages/tmp/var/lib/rpm --rebuilddb
|
||||
echo 'Trying makecache again now.'
|
||||
/usr/bin/yum makecache -c /etc/fedoracommunity/yum-repo.conf --enablerepo=*
|
||||
echo 'Releasing $LOCKFILE'
|
||||
EOF
|
||||
)
|
||||
|
||||
|
||||
echo "Acquiring $LOCKFILE..."
|
||||
flock $LOCKFILE -c "$rebuild"
|
||||
|
||||
|
||||
# If it failed, then try to nuke and rebuild the rpmdb first.
|
||||
if [ $? -eq 1 ] ; then
|
||||
echo 'makecache failed... sleeping for 10 seconds.'
|
||||
sleep 10
|
||||
echo 'Waking. Now trying to rebuild the rpmdb.'
|
||||
|
||||
echo "Acquiring $LOCKFILE..."
|
||||
flock $LOCKFILE -c "$nuke_and_rebuild"
|
||||
fi
|
|
@ -94,3 +94,23 @@
|
|||
with_items:
|
||||
- redis
|
||||
- fcomm-cache-worker
|
||||
|
||||
# Here's the indexer stuff
|
||||
- name: Copy some scripts for /usr/local
|
||||
copy: src="{{item}}" dest="/usr/local/bin/{{item}}" mode=0755
|
||||
with_items:
|
||||
- sync-yum
|
||||
when: install_packages_indexer
|
||||
|
||||
- name: Copy the indexer cronjobs
|
||||
copy: src="{{item}}" dest="/etc/cron.d/{{item}}"
|
||||
with_items:
|
||||
- cron-sync-yum
|
||||
- cron-sync-latest-builds
|
||||
- cron-sync-package-index
|
||||
- cron-flush-pkgs-cache
|
||||
when: install_packages_indexer
|
||||
|
||||
- name: Confygure Ye Olde Logge Rotatyr
|
||||
copy: src=cron_fcomm_log_rotate dest=/etc/logrotate.d/cron_fcomm_log_rotate
|
||||
when: install_packages_indexer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue