F5Networks / f5-cloud-libs

Node.js libraries to assist in cloud deployments.
Apache License 2.0
29 stars 14 forks source link

onboarding.js: multiple entries for the same argument doesn't work #23

Closed amolari closed 4 years ago

amolari commented 4 years ago

It seems that providing multiple entries for the same argumen (here, dbvars) in onboarding.js, such as

"-d tm.tcpudptxchecksum:software-only" "-d liveupdate.autodownload:disable"

doesn't work. The code in onboard.js uses:

.option(
                        '-d, --db <name:value>',
                        'Set db variable <name> to <value>. For multiple settings, use multiple -d entries.',
                        util.pairs,
                        dbVars
                    )

changing the argument to:

"-d tm.tcpudptxchecksum:software-only,liveupdate.autodownload:disable"

and the code to

.option(
                        '-d, --db <name:value>',
                        'Set db variable <name> to <value>. For multiple settings, use multiple -d entries.',
                        util.map,
                        dbVars
                    )

works. Some other parameters, such as DNS might have the same issue. F5 Support ticket: 1-6175786674

andreykashcheev commented 4 years ago

@amolari I have tested the current implementation (using latest AWS WAF Autoscale template) for passing -d variables to onboard.js script and my testing confirms the expected behavior. Please see logs below for more details:

2020-05-06T17:05:59.465Z info: [pid: 18175] [scripts/onboard.js] /config/cloud/aws/node_modules/@f5devcentral/f5-cloud-libs/scripts/onboard.js called with /usr/bin/f5-rest-node /config/cloud/aws/node_modules/@f5devcentral/f5-cloud-libs/scripts/onboard.js --log-level silly --wait-for ADMIN_CREATED --signal ONBOARD_DONE -o /var/log/cloud/aws/onboard.log --install-ilx-package file:///config/cloud/f5-appsvcs-3.18.0-4.noarch.rpm --host localhost --port 8443 --user my-admin --password-url file:///config/cloud/aws/.adminPassword --password-encrypted --hostname ip-10-0-0-249.us-west-2.compute.internal --ntp pool.ntp.org --tz UTC --dns 10.0.0.2 --ssl-port 8443 --modules ltm:nominal,asm:nominal,gtm:nominal -d tm.tcpudptxchecksum:software-only -d liveupdate.autodownload:disable --ping

2020-05-06T17:08:16.296Z debug: [pid: 18175] [lib/bigIp.js] {"kind":"tm:sys:db:dbstate","name":"liveupdate.autodownload","fullPath":"liveupdate.autodownload","generation":132,"selfLink":"https://localhost/mgmt/tm/sys/db/liveupdate.autodownload?ver=15.0.1.1","defaultValue":"enable","scfConfig":"true","value":"disable","valueRange":"disable enable"}

Here is BIGIP TMSH output:

admin@(ip-10-0-0-249)(cfg-sync Standalone)(Active)(/Common)(tmos)# list sys db liveupdate.autodownload sys db liveupdate.autodownload { value "disable" }

I have noticed that in your provided example, db variable defined the following way:

"-d tm.tcpudptxchecksum:software-only" "-d liveupdate.autodownload:disable"

I suspect that double quotes might causes the problem. Please pass -d parameters without putting them in double quotes:

-d tm.tcpudptxchecksum:software-only -d liveupdate.autodownload:disable

This can be easily tested by executing the following command via TMSH terminal:

/usr/bin/f5-rest-node /config/cloud/aws/node_modules/@f5devcentral/f5-cloud-libs/scripts/onboard.js --log-level silly --signal ONBOARD_DONE -o /var/log/cloud/aws/onboard.log --host localhost --port 8443 -d tm.tcpudptxchecksum:software-only -d liveupdate.autodownload:disable --ping

Let me know if you have any questions/concerns

amolari commented 4 years ago

my apologies. I was configuring it in the Autoscale CFT. At the wrong place. I confirm that changing

"-d tm.tcpudptxchecksum:software-only"

to

"-d tm.tcpudptxchecksum:software-only -d liveupdate.autodownload:disable"

works as expected.