Closed gfrankliu closed 3 years ago
@giteshk did you say you saw this same issue in Google Cloud due to the PHP RPMs being out of date?
@cnovak I created a pull request for this https://github.com/apigee/devportal-kickstart-drupal-ansible-installer/pull/7
@gfrankliu can you try this out ?
With @cnovak's suggestion, I have switched to centos 8 (which comes with php 7.2 by default, unlike centos 7 that comes with php5 by default). The ansible went much further, but failed with
TASK [Add NGINX configuration file for Devportal] ******************************
fatal: [web1]: FAILED! => {"changed": false, "checksum": "bdc143856efd2008730215b3d47bed3a517d9355", "msg": "Destination /etc/nginx/conf.d not writable"}
The "devportal" user has the sudo permission, but it seems for this particular job, it didn't use sudo.
Then I switched to use root user for ansible, and completed installation. Browsing the final website with nginx error 502 Bad Gateway
. Disabling selinux fixed that error. Since selinux came by default enabled, if you don't support it, shouldn't ansible disable it?
@gfrankliu I do believe that we should hardcode the php version to 7.3 Php 7.2 will end of life in the beginning of 2021. https://www.php.net/supported-versions.php I did see a whole bunch of errors because with the user permission too. But didn't get too far with testing the user.
We probably should disable selinux to accept traffic
Though upstream (php.net) announced EOL, the old php5 from centos 7 and php7.2 from centos 8 are still supported by the vendor (Redhat) until that centos version is EOL.
As for user permissions, are you suggesting we should document it to install using root user, since we haven't tested non-root user?
As for selinux, we should either document it in README, or make ansible do the check and disable as needed.
Here are my steps:
launch centos 8 in GCP
gcloud compute instances create devportal-test \
--project aaa \
--zone bbb \
--subnet ccc \
--network ddd \
--tags=eee \
--machine-type e2-standard-2 \
--image-family centos-8 \
--image-project centos-cloud \
--boot-disk-size 50GB
install devportal
# SSH into the new instance launched above
#
sudo su -
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' \
/etc/selinux/config
yum install -y epel-release yum install -y ansible git mkdir src cd src git clone https://github.com/apigee/devportal-kickstart-drupal-ansible-installer.git cd devportal-kickstart-drupal-ansible-installer cp test/hosts.yml . ansible-galaxy install -r requirements.yml ansible-playbook playbook.yml
- now devportal is available on http/80
I also tried on GCP Debian 10 successfully. Here are the steps:
Launch Debian 10 in GCP
gcloud compute instances create devportal-debian \
--project aaa \
--zone bbb \
--subnet ccc \
--network ddd \
--tags=eee \
--machine-type e2-standard-2 \
--image-family debian-10 \
--image-project debian-cloud \
--boot-disk-size 50GB
install devportal
# SSH into the new instance launched above
#
sudo su -
echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367
apt-get -y update
apt-get -y install git ansible
mkdir src
cd src
git clone https://github.com/apigee/devportal-kickstart-drupal-ansible-installer.git
cd devportal-kickstart-drupal-ansible-installer
cp test/hosts.yml .
ansible-galaxy install -r requirements.yml
printf '\nphp_default_version_debian: "7.3"\ndrupal_file_group: www-data\n' >> group_vars/webservers.yml
sed -i -E 's/(php_fpm_pool_.+): "nginx"/\1: "www-data"/g' group_vars/webservers.yml
ansible-playbook playbook.yml
rm -f /etc/nginx/sites-enabled/default
systemctl restart nginx
now devportal is available on http/80
Hi, I also tried the steps on CentOS 8 in GCP:
gcloud compute instances create devportal-test \
--project aaa \
--zone bbb \
--subnet ccc \
--network ddd \
--tags=eee \
--machine-type e2-standard-2 \
--image-family centos-8 \
--image-project centos-cloud \
--boot-disk-size 50GB
install devportal
# SSH into the new instance launched above
#
sudo su -
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' \
/etc/selinux/config
yum install -y epel-release
yum install -y ansible git
mkdir src
cd src
git clone https://github.com/apigee/devportal-kickstart-drupal-ansible-installer.git
cd devportal-kickstart-drupal-ansible-installer
cp test/hosts.yml .
ansible-galaxy install -r requirements.yml
ansible-playbook playbook.yml
However, the ansible-playbook playbook.yml
failed with the following error messages:
TASK [geerlingguy.drupal : Run composer install if composer.json is present.] ***************
fatal: [localhost]: FAILED! => {
"changed": false,
"msg": "No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file. Loading composer repositories with package information Updating dependencies Your requirements could not be resolved to an installable set of packages. Problem 1 - drupal/core-dev[8.8.0-beta1, ..., 8.9.x-dev] require jcalderonzumba/mink-phantomjs-driver ^0.3.1 -> found jcalderonzumba/mink-phantomjs-driver[dev-master, 0.4.x-dev (alias of dev-master)] but it does not match the constraint. - drupal/core-vendor-hardening 8.8.0-alpha1 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint. - drupal/core-dev 8.8.0-alpha1 requires drupal/core-vendor-hardening 8.8.0-alpha1 -> satisfiable by drupal/core-vendor-hardening[8.8.0-alpha1]. - Root composer.json requires drupal/core-dev ^8.8 -> satisfiable by drupal/core-dev[8.8.0-alpha1, ..., 8.9.x-dev]. You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2. Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.",
"stdout": "No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.\nLoading composer repositories with package information\nUpdating dependencies\nYour requirements could not be resolved to an installable set of packages.\n\n Problem 1\n - drupal/core-dev[8.8.0-beta1, ..., 8.9.x-dev] require jcalderonzumba/mink-phantomjs-driver ^0.3.1 -> found jcalderonzumba/mink-phantomjs-driver[dev-master, 0.4.x-dev (alias of dev-master)] but it does not match the constraint.\n - drupal/core-vendor-hardening 8.8.0-alpha1 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.\n - drupal/core-dev 8.8.0-alpha1 requires drupal/core-vendor-hardening 8.8.0-alpha1 -> satisfiable by drupal/core-vendor-hardening[8.8.0-alpha1].\n - Root composer.json requires drupal/core-dev ^8.8 -> satisfiable by drupal/core-dev[8.8.0-alpha1, ..., 8.9.x-dev].\n\nYou are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.\nRunning update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.\n",
"stdout_lines": [
"No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.",
"Loading composer repositories with package information",
"Updating dependencies",
"Your requirements could not be resolved to an installable set of packages.",
"",
" Problem 1",
" - drupal/core-dev[8.8.0-beta1, ..., 8.9.x-dev] require jcalderonzumba/mink-phantomjs-driver ^0.3.1 -> found jcalderonzumba/mink-phantomjs-driver[dev-master, 0.4.x-dev (alias of dev-master)] but it does not match the constraint.",
" - drupal/core-vendor-hardening 8.8.0-alpha1 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.",
" - drupal/core-dev 8.8.0-alpha1 requires drupal/core-vendor-hardening 8.8.0-alpha1 -> satisfiable by drupal/core-vendor-hardening[8.8.0-alpha1].",
" - Root composer.json requires drupal/core-dev ^8.8 -> satisfiable by drupal/core-dev[8.8.0-alpha1, ..., 8.9.x-dev].",
"",
"You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.",
"Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems."
]
}
The error message you posted above clearly stated:
You are using Composer 2, which some of your plugins seem to be incompatible with.
composer v2 was released between my post and your test. That's why you encountered the error but I didn't.
You can switch back to composer v1 and the error should go away. eg: you can append composer_version: 1.10.13
to the file group_vars/webservers.yml to force using composer version 1.10.13 , BEFORE you run the ansible-playbook
Hi @gfrankliu,
I tried your suggestion with composer_version: 1.10.13
, it just works!
Thank you for your great solution!
+1 for the help answering @gfrankliu , I will close this ticket.
Description
Ansible installation failed on Centos7 in GCP with below errors:
Steps to Reproduce
Steps to reproduce the behavior: