Ansible: conflicting action statements: group, tags - tags

I have following code in on of roles:
- name: Create user group
group: name={{ user.group }} state=present
tags:
- user
When I run ansible-playbook -i localhost --ask-become-pass playbook.yml I catch an error:
ERROR! conflicting action statements: group, tags
The error appears to have been in '/home/user/spark/roles/base/tasks/main.yml': line 12, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: Create user group
^ here
...
exception type: <class 'ansible.errors.AnsibleParserError'>
exception: conflicting action statements: group, tags
...
Full error log: https://www.pastiebin.com/59cb4faf9ae35
If I remove tags it runs without error.
It was compnow it is exception: unexpected parameter type in action: after I leave only name and tags. Full error log: pastiebin.com/59cb5b2996a10letely ok all the time but now it works like this without any identifiable reason. I tried to use previous working version of playbook (through git checkout ) but error exists anyway :(
I would be grateful for any hint on this.
P.S. I have fork of ansible playbook for Archlinux machine.
P.P.S.
ansible 2.4.0.0
config file = /home/user/spark/ansible.cfg
configured module search path = [u'/home/user/spark/library/ansible-aur']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.14 (default, Sep 20 2017, 01:25:59) [GCC 7.2.0]
Ansible aur:
[submodule "library/ansible-aur"]
path = library/ansible-aur
url = https://github.com/pigmonkey/ansible-aur.git
ansible.cfg
[defaults]
library = ./library/ansible-aur
UPD. If I remove group keyword like this:
- name: Create user group
tags:
- user
I catch an error: unexpected parameter type in action: after I leave only name and tags. Full error log: pastiebin.com/59cb5b2996a10

That's pretty funny story.
I have vim plugin that creates ctags tags for a project. And it created file named: spark/library/ansible-aur/tags.
It wasn't python file or something. It was just common ctags file.
I found that it was the root of all troubles by using pdb debugger with ansible code.
I've found one of error strings I saw: conflicting action statements in ansible code:
> /usr/lib/python2.7/site-packages/ansible/parsing/mod_args.py(293)parse()
-> raise AnsibleParserError("conflicting action statements: %s, %s" % (action, item), obj=self._task_ds)
And injected pdb.set_trace() there.
Then I make some study:
(Pdb) item
u'tags'
(Pdb) item in module_loader
True
(Pdb) module_loader.find_plugin(item)
u'/home/user/spark/library/ansible-aur/tags'
Last line was kind of hint. After deleting that tags file everything was completely ok.
Corresponding bug report: https://github.com/ansible/ansible/issues/31070

Related

Where actually is the syntax error in my github actions yml file

I am actually implementing CI/CD for my application. I want to start the application automatically using pm2. So I am getting the syntax error on line 22.
This is my yml file
This is the error I am getting on github
The problem in the syntax here is related to how you used the - symbol.
With Github actions, you need at least a run or uses field inform for each step inside your job, at the same level of the name field (which is not mandarory), otherwise the github interpreter will return an error.
Here, from line 22, you used something like this:
- name: ...
- run: ...
- run: ...
- run: ...
So there are two problems:
First, the name and the run field aren't at the same yaml level.
Second, your step with the name field doesn't have a run or uses field associated with it (you need at least one of them).
The correct syntax should be:
- name: ...
run: ...
- run: ...
- run: ...
Reference about workflow syntax

How can I let Hugo detect theme?

I am trying out a Hugo theme and what happened was when I used the command hugo server, I see the following error message.
Building sites … WARN 2020/07/20 14:33:07 Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
ERROR 2020/07/20 14:33:07 render of "taxonomy" failed: "D:\Hugo\bin\my_conf\themes\devfest-theme-hugo\layouts\_default\baseof.html:7:3": execute of template failed: template: taxonomy/list.html:7:3: executing "taxonomy/list.html" at <readFile "static/icons.svg">: error calling readFile: file "static\\icons.svg" does not exist
ERROR 2020/07/20 14:33:07 render of "home" failed: "D:\Hugo\bin\my_conf\themes\devfest-theme-hugo\layouts\_default\baseof.html:7:3": execute of template failed: template: index.html:7:3: executing "index.html" at <readFile "static/icons.svg">: error calling readFile: file "static\\icons.svg" does not exist
Built in 100 ms
Error: Error building site: failed to render pages: render of "taxonomy" failed: "D:\Hugo\bin\my_conf\themes\devfest-theme-hugo\layouts\_default\baseof.html:7:3": execute of template failed: template: taxonomy/list.html:7:3: executing "taxonomy/list.html" at <readFile "static/icons.svg">: error calling readFile: file "static\\icons.svg" does not exist
It seems saying that I misplaced some of the template files. I wonder if I have installed the theme correctly, or something I misunderstood?
What I have Done
Installed hugo and confirmed it is installed.
Created a new site called my-conf (Just trying out) and the themes directory.
I've cloned the repository into my themes directory. I am using GitHub Desktop on Windows.
Added the theme information using theme = "devfest-theme-hugo".
Used the command hugo server.
Ideally, you would add the themes as a submodule, as in the documentation, and the theme page itself:
hugo new site my-conf
cd my-conf
mkdir themes
git submodule add https://github.com/GDGToulouse/devfest-theme-hugo.git themes/devfest-theme-hugo
And add it to your configuration (which you seem to have done):
echo 'theme = "ananke"' >> config.toml
Then, regarding readFile:
To use the readFile function in your templates, make sure the path is relative to your Hugo project’s root directory:
{{ readFile "/content/templates/local-file-templates" }}
In the template: layouts/_default/baseof.html seems to have the right path.
Yet, looking at the history of GDGToulouse/devfest-theme-hugo/layouts/_default/baseof.html, I see it has changed during a commit "WIP 2020".
The version before that commit included:
{{ readFile "themes/devfest-theme-hugo/static/icons.svg" | safeHTML }}
Which, from the discussion, seems to work better!

Using ftp-deploy with load-grunt-tasks causes errors

I've split my Gruntfile into multiple files using load-grunt-tasks but seem to get an error when using ftp-deploy. I've tried some different things, but I reason that the hyphen (-) in the "ftp-deploy" might cause problems.
I'm getting the following error:
Running "ftp-deploy:theme" (ftp-deploy) task
Verifying property ftp-deploy.theme exists in config...ERROR
>> Unable to process task.
Warning: Required config property "ftp-deploy.theme" missing. Use --force to continue.
When running:
grunt "ftp-deploy:theme" --verbose
My ftp-deploy script looks as follows:
# FTP DEPLOY
# -------
module.exports =
'ftp-deploy':
theme:
auth:
host: 'host.com'
port: 21
authKey: 'key'
src: 'drupal/sites/all/themes/theme_name'
dest: 'www/host.com/sites/all/themes/theme_name'
I've tried running it without incapsulating it inside the "theme:" object which works, but is essentially not what I want to do as I have different folders I want to transfer.
Any ideas to what a solution might be?
I found the answer myself.
'ftp-deploy':
Should of course not be included in the file.

JSDoc Templates - "publish" not found

I've been able to get JSDoc3 working with the default template, however, when I try to run another template (even the one that comes with it,haruki) I get the following error:
js: "/path/to/jsdoc/jsdoc.js", line 308: exception from uncaught JavaScript throw: Error: Unable to load template: Module "haruki/publish" not found.
I've tried several other templates and get the same thing. Goven my freshman status with JSDoc I'm assuming it's some config or call issue that's tripping me up.
try to set full path to template folder with publish.js file (not only template name)
for example command line parameter
-t templates/docstrap-master/template
or in config.json file
{ ...
"opts": {
...
"template": "templates/docstrap-master/template"
}
}
it works for this https://github.com/terryweiss/docstrap
for Haruki it seems to work too ./jsdoc -c conf.json -t templates/haruki but i have another error:
This template only supports output to the console. Use the option "-d
console" when you run JSDoc.
With -d console it prints result to console

How to create NTEventlogAppender.dll as required for logging event in the eventlog using log4cplus

First, Let me thank for the log4cplus source code.
I am facing one issue as follows:
What I am trying to do?
I want to log the messages to event log on windows.
What did I do?
I could get the event logging enabled by in including following .h
#include <log4cplus/nteventlogappender.h>
And creating the appender as follows:
SharedAppenderPtr append_3(new NTEventLogAppender(LOG4CPLUS_TEXT("127.0.0.1"), LOG4CPLUS_TEXT("log"), LOG4CPLUS_TEXT("source")));
append_3->setName(LOG4CPLUS_TEXT("ToEventlog"));
Logger to_eventlog = Logger::getInstance(LOG4CPLUS_TEXT("to_eventlog"));
to_eventlog.addAppender(append_3);
to_eventlog.setLogLevel(log4cplus::ALL_LOG_LEVEL);
And logging as
Logger to_eventlog = Logger::getInstance(LOG4CPLUS_TEXT("to_eventlog"));
LOG4CPLUS_FATAL(to_eventlog, “Test Message.”);
When I log the message, I get following in the event log:
The description for Event ID 4096 from source source cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Test Message.
the message resource is present but the message is not found in the string/message table
I tried to create a dll with name NTEventLogAppender.dll with string table resource and a string with id 4096 (as hardcoded in the nteventlogappender.cxx file in log4cplus) and compiled it with resource only dll (/NOENTRY) but I still keep getting above error.
I already tried question to log4cplus-devel#lists.sourceforge.net but did not get any answer yet.
Any help on how to create this dll would be greatly appreciated.
Thanks.
This is how I resolved this issue:
comipiled NTEventLogAppender.mc file using commands:
mc -U NTEventLogAppender.mc
rc -r NTEventLogAppender.rc
link -dll -noentry -out:NTEventLogAppender.dll NTEventLogAppender.res
where NTEventLogAppender.mc has following contents
MessageIdTypedef=DWORD
SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS
Informational=0x1:STATUS_SEVERITY_INFORMATIONAL
Warning=0x2:STATUS_SEVERITY_WARNING
Error=0x3:STATUS_SEVERITY_ERROR
)
FacilityNames=(System=0x0:FACILITY_SYSTEM
Runtime=0x2:FACILITY_RUNTIME
Stubs=0x3:FACILITY_STUBS
Io=0x4:FACILITY_IO_ERROR_CODE
)
LanguageNames=(English=0x409:MSG00409)
; // The following are message definitions.
MessageId=0x1000
SymbolicName=SVC_TEST
Language=English
A message for something.
.
; // A message file must end with a period on its own line
; // followed by a blank line.
copied the NTEventLogAppender.dll to c:\windows\system32
and ran the above mentioned test program and found that event log found the message resource correctly.
you need to register this dll by copying following in .reg file and running the same
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\log\source]
"EventMessageFile"="C:\\windows\\system32\\NTEventLogAppender.dll"
"CategoryMessageFile"="C:\\windows\\system32\\NTEventLogAppender.dll"
"TypesSupported"=dword:00000007
"CategoryCount"=dword:00000005