Slackbot
06/17/2023, 2:29 PMcruelsmith
06/17/2023, 5:22 PMnpx vs npm i can not help.Joel Wilson
06/19/2023, 1:51 PMnpx is kind of a convenience thing for running a node module's commands in the context of the local package.json , probably if you just use an exec resource and set the current directory to the directory of the package.json, you'll get the behavior you need. You may need to put the standard idempotency gates on that exec, though (i.e. figure out what file to look for with creates or what to check with onlyif or unless)Code_Bleu
06/20/2023, 12:44 AMCode_Bleu
06/20/2023, 1:08 AMglee
06/20/2023, 1:11 AM$::db_name, $::db_user, etc top-scope variables? or where are they defined?Code_Bleu
06/20/2023, 1:12 AMglee
06/20/2023, 1:13 AM${profile::other::dbname} etcCode_Bleu
06/20/2023, 1:13 AMglee
06/20/2023, 1:13 AMCode_Bleu
06/20/2023, 1:14 AMclass role::strapi {
include profile::nodejs::install
include profile::postgresql::install
include profile::postgresql::config_strapi_db
include profile::nodejs::strapi_install
}
..and those variables are in the profile::postgresql::config_strapi_dbglee
06/20/2023, 1:14 AM${profile::postgresql::config_strapi_db::db_name} ... etcCode_Bleu
06/20/2023, 1:18 AMError: '/usr/bin/npx --yes create-strapi-app@latest my-proj --dbclient postgres --dbname --dbhost 127.0.0.1 --dbport 5432 --dbusername --dbpassword ' returned 1 instead of one of [0]
Error: /Stage[main]/Profile::nodejs::Strapi_install/Exec[npx create-strapi-app@latest my-proj]/returns: change from 'notrun' to ['0'] failed: '/usr/bin/npx --yes create-strapi-app@latest my-proj --dbclient postgres --dbname --dbhost 127.0.0.1 --dbport 5432 --dbusername --dbpassword ' returned 1 instead of one of [0] (corrective)glee
06/20/2023, 1:20 AMCode_Bleu
06/20/2023, 1:21 AMdb_name, db_user are just a variable at top of file with a string value
The db_pass is pulled in from and ENC eyaml fileglee
06/20/2023, 1:21 AMprofile::nodejs::strapi_install, then you could possibly add a require to your strapi_install profileglee
06/20/2023, 1:21 AMglee
06/20/2023, 1:21 AMglee
06/20/2023, 1:23 AMrequire profile::postgresql::config_strapi_db to profile::nodejs::strapi_install (ie: after class rofile::nodejs::strapi_install { , before your exec)Code_Bleu
06/20/2023, 1:24 AMglee
06/20/2023, 1:24 AMglee
06/20/2023, 1:24 AMCode_Bleu
06/20/2023, 1:25 AMglee
06/20/2023, 1:25 AMglee
06/20/2023, 1:25 AMglee
06/20/2023, 1:25 AMCode_Bleu
06/20/2023, 1:25 AMprofile::.....::db_userglee
06/20/2023, 1:26 AMglee
06/20/2023, 1:26 AMCode_Bleu
06/20/2023, 1:33 AMdb_user and db_name) however I'm getting this error now:
Error: sh: 1: S: not found
Error: /Stage[main]/Profile::nodejs::Strapi_install/Exec[npx create-strapi-app@latest my-proj]/returns: change from 'notrun' to ['0'] failed: sh: 1: S: not found
(corrective)glee
06/20/2023, 1:35 AMglee
06/20/2023, 1:36 AMglee
06/20/2023, 1:36 AMCode_Bleu
06/20/2023, 1:37 AMprovider => shell ?glee
06/20/2023, 1:37 AMglee
06/20/2023, 1:38 AMglee
06/20/2023, 1:38 AMCode_Bleu
06/20/2023, 1:39 AMglee
06/20/2023, 1:41 AMexec is running is returning "S: not found" -- ie: something called by npx (or the user profile that you're switching to) is passing S to the shell and causing it to return not foundglee
06/20/2023, 1:42 AMCode_Bleu
06/20/2023, 1:43 AMglee
06/20/2023, 1:44 AMCode_Bleu
06/20/2023, 1:45 AMS in the password...but there are some special characters too. So, I'm wondering if that is why it's messing up and returning the S ?Code_Bleu
06/20/2023, 1:45 AMglee
06/20/2023, 1:45 AMCode_Bleu
06/20/2023, 1:46 AMglee
06/20/2023, 1:47 AM--dbpassword \"${profile::postgresql::config_strapi_db::db_pass}\"",glee
06/20/2023, 1:47 AMglee
06/20/2023, 1:47 AM\"Code_Bleu
06/20/2023, 1:48 AMglee
06/20/2023, 1:48 AMCode_Bleu
06/20/2023, 1:48 AMglee
06/20/2023, 1:48 AMCode_Bleu
06/20/2023, 1:48 AMCode_Bleu
06/20/2023, 1:49 AM