In our company we're using ansible to target different environments, about 10 on the development and integration side, and 3 on the production side. Those environments have some differences in terms of the number of resources dedicated. For example let say in production we have a standalone server or vm dedicated to run the jvm, another one for dB... And in certain other environments those applications share the same server or vm. The problem is that some playbooks needs to be tweaked in order to target such an environment, so how could we do to make it as generic and transparent as possible?
Thanks for your advices
what you want to achieve is putting good hosts in good groups.
if you're familiar with ansible-inventory --graph, here is what you want to achieve:
#all:
|--#dev:
| |--devel1.domain.org
| |--devel2.domain.org
|--#db:
| |--db1.domain.org
| |--db2.domain.org
| |--dbprod1.domain.org
| |--appprod2.domain.org
|--#app:
| |--app1.domain.org
| |--app2.domain.org
| |--appprod1.domain.org
| |--appprod2.domain.org
|--#dev1:
| |--devel1.domain.org
| |--db1.domain.org
| |--app1.domain.org
|--#dev2:
| |--devel2.domain.org
| |--db2.domain.org
| |--app2.domain.org
|--#prod:
| |--#prod1:
| | |--dbprod1.domain.org
| | |--appprod1.domain.org
| |--#prod2:
| | |--appprod2.domain.org
here the host appprod2.domain.org will inherit from group_vars of app,db, prod,prod2
Related
i have installed cinder in controller node and block node.
i test the status of openstack-cinder-scheduler and openstack-cinder-api(on controller node) ,openstack-cinder-volume and target.service(on block node),that they are running.
but when i use the "cinder list,cinder create,openstack volume service list"only can get one kind of output:
[root#controller //]# openstack volume service list
The server is currently unavailable. Please try again at a later time.
The Keystone service is temporarily unavailable.
(HTTP 503)
[root#controller //]# cinder list
ERROR: The server is currently unavailable. Please try again at a later time.
The Keystone service is temporarily unavailable.
i have check the configure in cinder.conf,nova.conf serveral times.i have no idea with them.can u give a suggestion? thank you.
I found that I can create volume by dashboard, while by command line I can't. It may be something wrong between admin and cinder user. Try it again.
[root#controller //]# openstack volume list
+--------------------------------------+----------+-----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+----------+-----------+------+-------------+
| 435acaae-44d8-4793-9a0c-61a4436b6b37 | volumev4 | available | 1 | |
+--------------------------------------+----------+-----------+------+-------------+
[root#controller //]# openstack role add --project service --user cinder admin
[root#controller //]# openstack volume service list
+------------------+--------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated At |
+------------------+--------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller | nova | enabled | up | 2021-12-28T07:40:01.000000 |
| cinder-volume | compute2#lvm | nova | enabled | up | 2021-12-28T07:40:07.000000 |
+------------------+--------------+------+---------+-------+----------------------------+
it has the output.
I have a problem with file storage organization.
There is a network of Windows 7 and Windows XP computers. One of them is a file storage server.
Software packs are located on the storage server. Each software pack includes
1. active folder;
1. some folders for each program.
(see the structure example below)
Active folder is a structure of the actual program's versions, must allow to copy all the software in their actual versions avoiding file's duplicating via direct copying. Also fast switching of actual version is needed.
Program folders contain folders for each program's version.
I tried to solve the task via windows directory junction. I created the links via Far Manager 3, command Alt+F6, type directory junction.
Desired structure example
+---active % 389 MB, desired package of actual software
| +---notepad++ % directory junction
| | \---7.3.1
| | npp.7.3.1.Installer.exe
| | npp.7.3.1.Installer.x64.exe
| |
| +---octave % directory junction
| | \---4.2.1
| | octave-4.2.1-w32-installer.exe
| | octave-4.2.1-w64-installer.exe
| |
| \---texstudio % directory junction
| \---2.12.4
| texstudio-2.12.4-win-qt5.6.2.exe
|
+---notepad++
| +---6.8.8
| | npp.6.8.8.Installer.exe
| |
| \---7.3.1 % actual version
| npp.7.3.1.Installer.exe
| npp.7.3.1.Installer.x64.exe
|
+---octave
| +---4.2.0
| | octave-4.2.0-w32-installer.exe
| | octave-4.2.0-w64-installer.exe
| | octave-4.2.0-w64.zip
| |
| \---4.2.1 % actual version
| octave-4.2.1-w32-installer.exe
| octave-4.2.1-w64-installer.exe
|
\---texstudio
+---2.11.0
| texstudio-2.11.0-win-qt5.5.1.exe
|
+---2.12.0
| texstudio-2.12.0-win-qt5.6.2.exe
|
+---2.12.2
| texstudio-2.12.2-win-qt5.6.2.exe
|
\---2.12.4 % actual version
texstudio-2.12.4-win-qt5.6.2.exe
Local usage
Local means I operate on the storage server's Windows GUI.
If to copy active folder to another server's folder observed result is the same as desired:
TEST_COPY
\---active % 389 MB, all the files are copied
+---notepad++
| \---7.3.1
| npp.7.3.1.Installer.exe
| npp.7.3.1.Installer.x64.exe
|
+---octave
| \---4.2.1
| octave-4.2.1-w32-installer.exe
| octave-4.2.1-w64-installer.exe
|
\---texstudio
\---2.12.4
texstudio-2.12.4-win-qt5.6.2.exe
Network file access
If to access to the storage server's active folder via network sharing and copy it the desired result does not happen.
Of course, tree /A /F command shows the same structure of the copied tree, but active is 0 MB size and child folders notepad++, octave, texstudio are also zero-sized and empty.
TEST_COPY
\---active % 0 MB, no any files, only subfolders
+---notepad++
| \---7.3.1
|
+---octave
| \---4.2.1
|
\---texstudio
\---2.12.4
Only if try to copy directly directory junctions subfolders inside active folder (7.3.1, 4.2.1, 2.12.4) the content will be copied as desired. But every user wants to copy active folder, not its second level childs.
BTW. Sometimes when trying to copy an error occurred: file/folder already exists, and copy process was broken unexpectedly.
May be links are set up wrong or there are other methods to reach the desired result.
We are using SpecFlow for functional tests that suppose to replace manual testing when a human reads generated email and validates that all sections match specification. The problem is that Scenario Outlines become to grow to have too many parameters
Scenario Outline: generate and send confirmation email
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section1 should have parameters '<Param1_1>', '<Param1_2>', '<Param1_3>',...
Then section2 should have parameters '<Param2_1>', '<Param2_2>', '<Param2_3>',..
Then section3 should have parameters '<Param3_1>', '<Param3_2>', '<Param3_3>',...
....
Examples:
| EmbeddedItinerary | Param1_1| Param1_2| Param1_3| Param2_1| Param2_2| Param2_3| Param3_1| Param3_2| Param3_3|...
| Itinerary_1 | Value1_1 | Value1_2 | Value1_3 | Value2_1 | Value2_2 | Value2_3 |Value3_1 | Value3_2 | Value3_3 |...
| Itinerary_1 | Value1_1 | Value1_2 | Value1_3 | Value2_1 | Value2_2 | Value2_3 |Value3_1 | Value3_2 | Value3_3 |...
But the number of columns in Examples would become unmanageable. I wish to have multi-line examples ( but with different reason then in Multiple Multi-Line Examples in SpecFlow Feature File).
The option that I see is to store all ExpectedResults in embedded xml or json resource file, and have SpecFlow features quite small e.g.
Scenario Outline: generate and send confirmation email with correct email address for flight section
Given I have stored embedded resource '<EmbeddedItinerary>'
When Generate confirmation email
Then sections should be as specified in '<ExpectedResultsFile>'
Examples:
| EmbeddedItinerary | ExpectedResultsFile
| Itinerary_1 | ExpectedResults1 |
| Itinerary_2 | ExpectedResults2 |
...
Is it a good idea?
Can anyone suggest better way ( more SpecFlow style)?
My concern is that moving expected data to separate files I am loosing visibility, that is one of advantages of SpecFlow features.
Update: while writing this question I found commercial product ($AUD 255 per user) Specflow+Excel http://www.specflow.org/plus/excel/getting-started/ , which may satisfy my requirement to maintain many columns.
Is it a mature/reliable product? Should I use it instead of own parsing expected results files in proprietary format?
If I have a lot of parameters in a Scenario Outline, I try to work as much as possible with default parameters or split the Scenario Outline in multiple ones.
I think in your case, it should be possible to split the one 'generate and send confirmation email' Scenario Outline in multiple ones that you have a scenario outline for every section.
This would reduce the amount of needed parameters per scenario and you get faster feedback if an error occurs. You immediately see in which section you have an error.
e.g.:
Scenario Outline: generate and send confirmation email - section 1
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section1 should have parameters '<Param1_1>', '<Param1_2>', '<Param1_3>',...
Examples:
| EmbeddedItinerary | Param1_1 | Param1_2 | Param1_3 |
| Itinerary_1 | Value1_1 | Value1_2 | Value1_3 |
Scenario Outline: generate and send confirmation email - section 2
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section2 should have parameters '<Param2_1>', '<Param2_2>', '<Param2_3>',..
Examples:
| EmbeddedItinerary | Param2_1 | Param2_2 | Param2_3 |
| Itinerary_1 | Value2_1 | Value2_2 | Value2_3 |
Scenario Outline: generate and send confirmation email - section 3
Given I have stored itinerary in '<EmbeddedItinerary>'
When Generate confirmation email
Then section3 should have parameters '<Param3_1>', '<Param3_2>', '<Param3_3>',...
Examples:
| EmbeddedItirerary | Param3_1 | Param3_2 | Param3_3 |
| Itinerary_1 | Value3_1 | Value3_2 | Value3_3 |
About SpecFlow+Excel: That is also an option. Maintaining examples in Excel is most of the time easier than in the feature- file. It will at least solve your problem in short term, but you have to be also careful to write scenarios that are still understandable and readable.
You can get a trial license for it from here: http://www.specflow.org/request-your-specflow-trial-license/
Full Disclosure: I am one of the developers of SpecFlow+ (Runner & Excel).
I am working in a djangocms project that uses the djangocms_text_ckeditor https://github.com/divio/djangocms-text-ckeditor
I would like to integrate a wordcount plugin similar to this https://github.com/w8tcha/CKEditor-wordcount-Plugin
Have someone of you did this before successfully? It would be great if I could get the plugin via pip or so, not downloading and including it in the project. And also, how would the CKEDITOR_SETTINGS look like?
I couldn't find any workaround, just a similar post but that does not use this djangocms text editor for that purpose.
Thanks in advance!
The extension is a javascript plugin for the ckeditor (as opposed to a djangocms plugin).
To load a javascript plugin two steps are needed:
Make the js plugin resources available to ckeditor. This is done through static folder in your project wich includes all js, css etc. files. In the static folder create the folders djangocms_text_ckeditor/ckeditor/plugins. Copy the js plugin into this folder. In your case thats the whole folder wordcount. The directory tree should look like
static
|
+---djangocms_text_ckeditor
| |
| +---ckeditor
| | |
| | +---plugins
| | | |
| | | +---wordcount
| | | | |
| | | | +---css
| | | | +---lang
| | | | +---plugin.js
Let the djangocms plugin ckeditor know about the js plugin. To this end, look for the setting CKEDITOR_SETTINGS in your project's settings.py file. If it is not there create it. It's a dictionary that is used, e.g., to configure the toolbars. In this dictionary have a key extraPlugins with a string value that consists of comma separated names of plugins to load, e.g.,
CKEDITOR_SETTINGS = {
...,
'extraPlugins': 'cmsplugins,wordcount,glyphicons,...',
...,
}
Hope that works for you.
Is it possible to use different tables based on previous steps?
So suppose I have something like
When I choose from a <list> of things
And I run a <test> from that thing chosen with special <parameter>
Examples:
|list|
| a |
| b |
| a |
| test | parameter |
| mytest1 | myparameter1 |
| mytest2 | myparameter2 |
| b |
| test | parameter|
| mytest1 | myparameter3 |
| mytest2 | myparameter4 |
Is this possible and what would be the correct structure?
No its not, and it is a very bad idea. Generally when you want to do programming in your scenarios, you should do it by
Giving it a name
Pushing the programming down into the step definitions
In this particular case you seem to want to be doing some sort of exhaustive testing, where you try a single operation under a number of different conditions. Cucumber is not appropriate for this sort of testing. Instead find a way to do these sort of tests at a lower level of abstraction e.g. a unit test.
The main reason for not doing exhaustive testing in Cucumber is the runtime cost. As a rough rule of thumb each integration test (Cucumber) has a run time cost of hundreds of unit tests (maybe thousands of good unit tests).