MrMEEE / harbor-rpm-ansible

Role to deploy Harbor Registry with RPMs
2 stars 1 forks source link

Initialize databases Module remote_tmp /var/lib/pgsql/.ansible/tmp did not exist #3

Open patsevanton opened 4 years ago

patsevanton commented 4 years ago
TASK [harbor-rpm : Initialize databases] ***************************************
[WARNING]: Module remote_tmp /var/lib/pgsql/.ansible/tmp did not exist and was
created with a mode of 0700, this may cause issues when running as another
user. To avoid this, create the remote_tmp dir with the correct permissions
manually

fatal: [172.26.9.126]: FAILED! => {
    "changed": false, 
    "cmd": "for i in '`ls' '/etc/harbor/db/initial/*.sql`;do' su - postgres -c 'scl enable rh-postgresql10 \"psql -f $i\"' ';done'", 
    "rc": 2
}

MSG:

[Errno 2] No such file or directory
MrMEEE commented 4 years ago

hmm... sound like some packages are missing...

what does "rpm -qa |grep harbor" show??

patsevanton commented 4 years ago
rpm -qa |grep harbor
harbor-registryctl-1.10.1_rc1-1.el7.x86_64
harbor-registry-2.7.1-4.el7.x86_64
harbor-core-1.10.1_rc1-1.el7.x86_64
harbor-1.10.1_rc1-1.el7.x86_64
harbor-clair-2.1.1-1.el7.x86_64
harbor-jobservice-1.10.1_rc1-1.el7.x86_64
harbor-chartserver-0.9.0-4.el7.x86_64
harbor-portal-1.10.1_rc1-1.el7.x86_64
patsevanton commented 4 years ago
yum list harbor-*
Installed Packages
harbor.x86_64              1.10.1_rc1-1.el7  @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-chartserver.x86_64  0.9.0-4.el7       @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-clair.x86_64        2.1.1-1.el7       @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-core.x86_64         1.10.1_rc1-1.el7  @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-jobservice.x86_64   1.10.1_rc1-1.el7  @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-portal.x86_64       1.10.1_rc1-1.el7  @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-registry.x86_64     2.7.1-4.el7       @copr:copr.fedorainfracloud.org:mrmeee:harbor
harbor-registryctl.x86_64  1.10.1_rc1-1.el7  @copr:copr.fedorainfracloud.org:mrmeee:harbor
patsevanton commented 4 years ago
ls -ld /var/lib/pgsql/.ansible/tmp
drwx------ 2 postgres postgres 6 Feb 12 03:52 /var/lib/pgsql/.ansible/tmp
patsevanton commented 4 years ago
ls -l /etc/harbor/db/initial
total 28
-rw-r--r-- 1 harbor harbor 4077 Dec  6 15:00 docker-entrypoint.sh
-rw-r--r-- 1 harbor harbor  754 Dec  6 15:00 Dockerfile
-rw-r--r-- 1 harbor harbor  823 Dec  6 15:00 Dockerfile.base
-rw-r--r-- 1 harbor harbor  464 Dec  6 15:00 docker-healthcheck.sh
-rw-r--r-- 1 harbor harbor  160 Dec  6 15:00 initial-notaryserver.sql
-rw-r--r-- 1 harbor harbor  160 Dec  6 15:00 initial-notarysigner.sql
-rw-r--r-- 1 harbor harbor  148 Dec  6 15:00 initial-registry.sql
patsevanton commented 4 years ago
su - postgres
-bash-4.2$ for i in `ls /etc/harbor/db/initial/*.sql`;do su - postgres -c "scl enable rh-postgresql10 \"psql -f $i\"" ;done
Password: 
patsevanton commented 4 years ago
sudo -H -u postgres bash -c 'for i in `ls /etc/harbor/db/initial/*.sql`;do su - postgres -c "scl enable rh-postgresql10 \"psql -f $i\"" ;done' 
Password: 
patsevanton commented 4 years ago

There is still an error

patsevanton commented 4 years ago

How to help fix this error?