Re: [ansible-project] Re: Incomprehensible error message
On Thu, 18 Jan 2024 12:38:09 +0700 Ian Hobson wrote: > The comma separated list of privileges, cannot have spaces after the > commas. > > This is unusually user-hostile! This was fixed two years ago https://github.com/ansible-collections/community.mysql/blob/main/plugins/module_utils/user.py#L522 See also: https://github.com/ansible-collections/community.mysql/pull/189 https://github.com/ansible-collections/community.mysql/pull/243 -- Vladimir Botka -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20240118083057.28a18ab8%40gmail.com. pgpsWpx_fOKvT.pgp Description: OpenPGP digital signature
[ansible-project] Regarding No space left on device error
Hi All, I have been facing the following issue: /home/ansible/.ansible/tmp/ansible-tmp: No space left on device. I have cleared the space in Ansible server and another server but the issue still persists. Can some one please help me? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHirXmja0tfd821B701n9fnQWkv%2BcSk60UQNTdRvzQvArg%40mail.gmail.com.
[ansible-project] Re: Incomprehensible error message
Found the problem. The comma separated list of privileges, cannot have spaces after the commas. This is unusually user-hostile! Regards Ian On 18/01/2024 11:47, Ian Hobson wrote: Hi All, I am attempting to use Ansible to create a MySQL backup user. It should be able to read and lock tables for everything. The step in the playbook is this. - name: create user - GRANT SELECT, PROCESS, LOCK TABLES ON *.* TO `backup`@`localhost` community.mysql.mysql_user: user: backup host: localhost login_password: priv: '*.*:SELECT, PROCESS, LOCK TABLES' The error message is: fatal: [ubuntu2004.hcs]: FAILED! => {"changed": false, "msg": "invalid privileges string: Invalid privileges specified: frozenset({' PROCESS, LOCK TABLES'})"} I can see nothing wrong with the priv line. Can someone suggest someth Regards Ian -- Ian Hobson Tel (+66) 626 544 695 -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/49c1c8b0-dfc3-4ad4-9096-f450445c6339%40gmail.com.
Re: [ansible-project] Incomprehensible error message
Hi Ian, There was a similar issue back in 2015/16, see https://github.com/ansible/ansible/issues/29611 and also https://stackoverflow.com/questions/28908155/ansible-mysql-user-priv-invalid-privileges-string-invalid-privileges-specifi amongst quite a few others. They all referenced spaces being in the privilege string. Are you able to try that without the spaces between privileges? Cheers David On Thu, 18 Jan 2024 at 14:18, Ian Hobson wrote: > Hi All, > > I am attempting to use Ansible to create a MySQL backup user. It should > be able to read and lock tables for everything. The step in the playbook > is this. > > - name: create user - GRANT SELECT, PROCESS, LOCK TABLES ON *.* TO > `backup`@`localhost` >community.mysql.mysql_user: > user: backup > host: localhost > login_password: > priv: '*.*:SELECT, PROCESS, LOCK TABLES' > > The error message is: > fatal: [ubuntu2004.hcs]: FAILED! => {"changed": false, "msg": "invalid > privileges string: Invalid privileges specified: frozenset({' PROCESS, > LOCK TABLES'})"} > > I can see nothing wrong with the priv line. Can someone spot it? > > Regards > > Ian > > -- > Ian Hobson > Tel (+66) 626 544 695 > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-project+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/16f33419-6d92-4097-a0ea-aa52532e29e8%40gmail.com > . > -- if in trouble, or in doubt run in circles, scream and shout -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2B8iFp4ZPvrh9nX5YiD%3DPw15REvXcahBdogGqiSRZe64FOvxHw%40mail.gmail.com.
[ansible-project] Incomprehensible error message
Hi All, I am attempting to use Ansible to create a MySQL backup user. It should be able to read and lock tables for everything. The step in the playbook is this. - name: create user - GRANT SELECT, PROCESS, LOCK TABLES ON *.* TO `backup`@`localhost` community.mysql.mysql_user: user: backup host: localhost login_password: priv: '*.*:SELECT, PROCESS, LOCK TABLES' The error message is: fatal: [ubuntu2004.hcs]: FAILED! => {"changed": false, "msg": "invalid privileges string: Invalid privileges specified: frozenset({' PROCESS, LOCK TABLES'})"} I can see nothing wrong with the priv line. Can someone spot it? Regards Ian -- Ian Hobson Tel (+66) 626 544 695 -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/16f33419-6d92-4097-a0ea-aa52532e29e8%40gmail.com.
Re: [ansible-project] backslashes in regex_replace filter
Thanks everyone. I'm going to chalk this up to a Python anomaly. IMO, since \d is not a valid escape sequence, Python should raise an error rather than transparently converting it into \\d. On Thu, Jan 11, 2024 at 6:19 PM Matt Martz wrote: > Part of the problem is also knowing what characters are escape sequences > in python. > > \1 is an escape sequence, equivalent to `\x01`, and not equivalent to the > literal `\1`. As such a literal `\1` needs to be represented in python as > `\\1`. \d is not an escape sequence and thus can be written as a literal > `\d` without escaping the `\` > > There is also a difference with quoting in YAML as mentioned above, > between single quotes and double quotes. But note that the behavior of > YAML with quotes only applies to quotes that surround the entire YAML > value. So the single quotes you have in the middle of your string do not > affect the YAML quoting differences. When not using quotes surrounding the > full value in YAML, you are using "Plain Style" which has different rules > than both single and double quoted values. > > YAML single quotes are basically equivalent to python raw strings, where a > backslash is always treated as literal. Double quotes require escaping > backslashes. You can read more about the flow scalar styles of YAML at > https://yaml.org/spec/1.2.2/#73-flow-scalar-styles > > On Tue, Jan 9, 2024 at 8:37 AM Rob Wagner wrote: > >> But the \1 is also inside single and double quotes, so if that were the >> reason, I wouldn’t have to double backslash the 1 >> >> On Jan 9, 2024, at 9:19 AM, 'Rowe, Walter P. (Fed)' via Ansible Project < >> ansible-project@googlegroups.com> wrote: >> >> Perhaps because you have single quotes inside double quotes so >> everything inside the single quotes is automatically escaped? >> >> Walter >> -- >> Walter Rowe, Division Chief >> Infrastructure Services Division >> Mobile: 202.355.4123 >> >> On Jan 9, 2024, at 9:04 AM, Rob Wagner wrote: >> >> Right, but why doesn’t the \\d need to be double-backslashed? >> Backslash-d is regex for matching on a digit. I just don’t get why >> doubling the backslash is needed on the 1 but not on the d. >> >> On Jan 9, 2024, at 7:53 AM, 'Rowe, Walter P. (Fed)' via Ansible Project < >> ansible-project@googlegroups.com> wrote: >> >> The \\1 must be double-backslashed because the backref needs to be >> backslash-digit (\1). Doubling the backslash escapes the backslash. >> >> Walter >> -- >> Walter Rowe, Division Chief >> Infrastructure Services Division >> Mobile: 202.355.4123 >> >> On Jan 8, 2024, at 6:57 PM, Rob Wagner wrote: >> >> Thanks Matt, but I still don't get why the first parameter (\\d) MAY be >> double backslashed but the second parameter (\\1) MUST be double >> backslashed. However, I'm starting to think it's at the python level. >> https://stackoverflow.com/a/33582215 says Python's string parser causes >> both \d and \\d to become \d. But why? A little more searching takes me to >> >> https://docs.python.org/3/reference/lexical_analysis.html#escape-sequences, >> where I think I see why \\1 becomes \1 and \1 becomes a non-printable >> character (octal 1). But then, by analogy, \\d should become \d (it does) >> but why doesn't \d become an error (since it's not listed as a valid escape >> sequence). >> >> Maybe I'll take this over to the Python list. >> >> On Mon, Jan 8, 2024 at 4:52 PM Matt Martz wrote: >> >>> This is a result of some normalization code in jinja2 that attempts to >>> unescape strings: >>> >>> >>> https://github.com/pallets/jinja/blob/d594969d722ceb4e8f3da8861befc9c0ac87ae1b/src/jinja2/lexer.py#L647-L653 >>> >>> That code results in those becoming '^p(\\d+).*$' and '\\1'. >>> >>> Those 2 when statements, when processed by pyyaml become: >>> >>> ["( item | regex_replace('^p(\\d+).*$', '1') ) in s", >>> "( item | regex_replace('^p(d+).*$', '1') ) in s"] >>> >>> Then if we apply the .encode/.decode: >>> >>> >>> "( item | regex_replace('^p(\\d+).*$', '1') ) in >>> s".encode("ascii", "backslashreplace").decode("unicode-escape") >>> "( item | regex_replace('^p(\\d+).*$', '\\1') ) in s" >>> >>> >>> "( item | regex_replace('^p(d+).*$', '1') ) in >>> s".encode("ascii", "backslashreplace").decode("unicode-escape") >>> "( item | regex_replace('^p(\\d+).*$', '\\1') ) in s" >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "Ansible Project" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/ansible-project/A-QsBqBiWVk/unsubscribe >>> . >>> To unsubscribe from this group and all its topics, send an email to >>> ansible-project+unsubscr...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/ansible-project/CAD8N0v-Sf3AmrkEnFZZtxAbJHTUv%3D6gNezDkESTxoatHq-86YA%40mail.gmail.com >>>