Cloud-init validator - cloud-init

Wondering if anyone knows of a validator that can validate cloud-init config similar to this. We tried it and it gives a bunch of errors that are not applicable e.g., it does not recognize package_update which is a standard keyword that can be found here in the official documentation for example. So we are looking for a validator that works and recognizes the keywords in the official documentation.

I hit this one recently too and found a nice way to do it.
In Ubuntu you can use the follwoing to validate the file parses correctly.
cloud-init schema --config-file bob.txt
This will give you the following notice if the files are valid or invalid
:~$ sudo cloud-init schema --config-file bob.txt
Valid cloud-config file bob.txt
$ nano bob.txt #edited the yaml to make it invalid
:~$ sudo cloud-init schema --config-file bob.txt
Cloud config schema errors: format-l2.c1: File bob.txt is not valid yaml. while parsing a block mapping
in "<byte string>", line 2, column 1:
package_upgrade: true
^
expected <block end>, but found '-'
in "<byte string>", line 6, column 1:
- 'curl -fsSL https://get.docker ...
^
While your working with cloud init files cloud-init status --wait and many of the other commands on the cli are super useful.

Starting from version 22.2, the cloud-init command to validate config file is now:
cloud-init schema --config-file conf.yaml

Related

installation error in shopware-pwa initialization

I am trying to install shopware-pwa. I am following the steps in https://github.com/vuestorefront/shopware-pwa
But at the first step while initializing the project npx #shopware-pwa/cli init
While installing I used default option:
* Shopware instance address: · https://shopware6-demo.vuestorefront.io
* Shopware instance access token: · SWSCVJJET0RQAXFNBMTDZTV1OQ
* Which version you'd like to use: latest stable (recommended)
Error: Command failed: npx --ignore-existing create-nuxt-app#3.2.0 --answers "{\"name\":\"shopware-pwa-project\",\"description\":\"shopware-pwa-project description\",\"author\":\"Vue Storefront\",\"pm\":\"yarn\",\"ui\":\"none\",\"language\":\"js\",\"server\":\"none\",\"features\":[\"axios\",\"pwa\"],\"linter\":[\"prettier\",\"lintStaged\"],\"test\":\"jest\",\"mode\":\"universal\",\"target\":\"server\",\"devTools\":[],\"gitUsername\":\"\",\"ci\":\"none\"}"
npx: the --ignore-existing argument has been removed.
See `npm help exec` for more information
Trace: Error: Answers JSON could not be parsed (Unexpected token n in JSON at position 1)
at SAO.runGenerator (/home/user/.npm/_npx/059d932392171cf4/node_modules/sao/lib/index.js:126:15)
at SAO.run (/home/user/.npm/_npx/059d932392171cf4/node_modules/sao/lib/index.js:101:16)
at /home/user/.npm/_npx/059d932392171cf4/node_modules/create-nuxt-app/lib/cli.js:51:17
Does anybody come up with the issue?
I found issue #612 in the create-nuxt-app GitHub repository.
It seems that after the --answers argument you'd have to start with a sinqle quote (') and then paste your configuration as a JSON. The JSON must not contain any linefeeds/carriage returns and there must not be any whitespaces ( ) between the properties.
So in your case your bash command should look like this:
npx --ignore-existing create-nuxt-app#3.2.0 --answers '{"name":"shopware-pwa-project","description":"shopware-pwa-project description","author":"Vue Storefront","pm":"yarn","ui":"none","language":"js","server":"none","features":["axios","pwa"],"linter":["prettier","lintStaged"],"test":"jest","mode":"universal","target":"server","devTools":[],"gitUsername":"","ci":"none"}'
I've tried it on my machine just now and it worked. I only got a warning becausethe --ignore-existing argument has been removed.
hope that this solves your problem!
greetings

How to use plugin commands in bcftools?

My goal is to use bcftools to check that the reference alleles in my dataset (vcf file) match with a reference genome (fasta file) using the fixref plugin.
Working on command line, I first set the following environment:
export BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
The following code is recommended for test datasets with mismatches:
bcftools +fixref test.bcf -Ob -o output.bcf -- -f ref.fa -m top
When I run this code using my own files (please note that my data is .vcf, not .bcf) I get the following error:
[main] Unrecognized command
If I simply enter:
bcftools
I get a list of the only 5 commands (view, index, cat, ld, ldpair) that I can use. So although I've set the environment, does it somehow need to be activated? Do I need to run my command through a bash script?
bcftools
was pointing to a deprecated version of bcftools (0.1.19) in ../bin/, while
BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
was pointing to the plugins for bcftools version 1.10.2 outside /bin/
Replacing ../bin/bcftools (0.1.19 with 1.10.2) was the fix.

Config file missing when running Confluent Platform

When I start confluent platform I get an error [ERROR] unable to load config: unable to parse config file: /home/user/.confluent/config.json: unexpected end of JSON input. There is no file in the path shown in the error.
Unexpected EOF would suggest the file is present. .confluent directory is hidden, so it's not clear how you've checked if the file exists.
Try ls -laR~/.confluentorfind $HOME -name config.json`...
In any case, kafka-server-start should work fine, and I suggest using it

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

Openldap : overlay accesslog not found

I am trying to configure accesslog. I have changed the slapd.conf file and trying to test using slaptest but i am getting error while executing slaptest -f /etc/openldap/slapd.conf.
slapd.conf configuration:
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
include /etc/openldap/schema/core.schema
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/nis.schema
.
.
modulepath /usr/lib/openldap/
moduleload accesslog.la
overlay accesslog
logdb "cn=accesslog"
logops writes
logsuccess TRUE
I am getting error at overlay accesslog
overlay "accesslog" not found
slaptest: bad configuration file!
Am I missing something..?
I found the issue on my own. I have not compiled the openldap with --enable overlay.
To solve this issue
i have downloaded the openldap src
./configure --enable-overlays (./configure [options] [variable=value ...])
Now modify the slapd.conf to load accesslog.la and execute slaptest -f /etc/openldap/slapd.conf. Now you wont find any error.
restart the slapd.