Re: [ansible-project] Using raw passwords with ansible_password directly in playbooks deprecated?

2020-10-30 Thread James Cassell
deprecated, but now I can't find where > it says so. Is this method being deprecated, or am i mis-recollecting? > You're doing it properly. There is also ansible_ssh_pass, but that's been emphasized less in favor of the ansible_password transport-agnostic version. V/r, James Casse

Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread James Cassell
The galaxy releases are lagging behind, but this probably is what you want: https://github.com/ansible-lockdown/RHEL7-CIS V/r, James Cassell On Thu, Sep 10, 2020, at 4:26 AM, Josephsimon Arokiaraj wrote: > Hi All, > > How you doing? > > Do we have any playbooks/roles

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread James Cassell
> On Mon, 8 Jun, 2020, 10:54 pm James Cassell, > wrote: > > > > On Mon, Jun 8, 2020, at 11:25 AM, Mukuntha rajaa wrote: > > > Hello, > > > > > > "become" works perfectly fine with "command" module. Bu

Re: [ansible-project] sudo(become) difference between "copy" module and "command" module

2020-06-08 Thread James Cassell
* > fatal: [localhost]: FAILED! => {"msg": "an error occurred while trying > to read the file '/etc/ssh/sshd_config': [Errno 13] Permission denied: > b'/etc/ssh/sshd_config'"} > You want `remote_src: yes`... otherwise it's trying to read the file fr

Re: [ansible-project] aws community edition and collection

2020-06-04 Thread James Cassell
nd it difficult to type `ansible -m community.general.my_module ...` using the very long name versus the short name you've always used before. V/r, James Cassell -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

Re: [ansible-project] Setting Variable across multiple hosts blocks

2020-06-01 Thread James Cassell
On Mon, Jun 1, 2020, at 11:49 AM, Brian Coca wrote: > The 'implicit localhost' is not part of ALL: > https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html > Documentation gold! Thanks! V/r, James Cassell -- You received this message because you are s

Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available

2020-05-24 Thread James Cassell
> On Sun, May 24, 2020 at 4:08 PM James Cassell > wrote: > > > > On Sun, May 24, 2020, at 6:56 PM, Tony Wong wrote: > > > --- > > > - name: get info vm > > > hosts: localhost > > > connection: local > > > gather_facts: fal

Re: [ansible-project] [WARNING]: provided hosts list is empty, only localhost is available

2020-05-24 Thread James Cassell
rk$ > tony@ubuntu:~/ansiblework$ > tony@ubuntu:~/ansiblework$ > tony@ubuntu:~/ansiblework$ ansible-playbook vmware_tools.yml > > > > > > why is it when i run this pb > > I get nothing but this > > [WARNING]: provided hosts list is empty, only localhos

Re: [ansible-project] Forced --limit

2020-05-06 Thread James Cassell
gt; I explain, if i don't use --limit, my playbook will deploy on all my > devices. > Me, I want my playbook don't run if --limit is not defined on my run > ansible-playbook command > I use - hosts: "{{ ansible_limit }}" V/r, James Cassell -- You received this message

Re: [ansible-project] Ansible-playbook

2020-04-18 Thread James Cassell
e1]: FAILED! => {"changed": false, "msg": "This command > has to be run under the root user.", "results": []} > > > Can you please tell me which configs should be made in order to install > services on ansible user? > Pass `-b` to your ansib

Re: [ansible-project] OS support contribution guidelines

2020-03-17 Thread James Cassell
onger possible to add non-namespaced modules or plugins, and best you can do is community.general.my_module.) V/r, James Cassell [1] https://meetbot.fedoraproject.org/ansible-meeting/2020-03-17/ansible_core_public_irc_meeting_https:github.comansiblecommunityissues528.2020-03-17-19.01.log.htm

Re: [ansible-project] rescue block does not print message despite being invoked

2020-03-12 Thread James Cassell
nd_result > failed_when: command_result.rc == 0 and action == "onboard" > > > rescue: > - name: Print custom conditional debug message > fail: > msg: >- > {{ > command_result.rc == 0 | You're missing parenthesis around the condition. V/r, James

Re: [ansible-project] Every SSH connection logs mux_client_read_packet: read header failed: Broken pipe

2020-03-03 Thread James Cassell
nections are terminating like this? > > > > Full debug output here: > https://gist.github.com/johnbateman/c2257c750798d1f48adc95deb66e3b61#file-gistfile1-txt > > Maybe try just 3 v's... I got lost in the output. V/r James Cassell > > ` > `ansible 2.9.4 >

Re: [ansible-project] Ansible delegate to another host

2020-02-21 Thread James Cassell
quot; with prod server ip (identified as part of step 2), it > fails. > Make sure the host is in your inventory, or try add_host to get it there. V/r, James Cassell -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsub

Re: [ansible-project] nmcli module seems broken. Documention mentions old libraries for CentOS8/RHEL8

2020-02-09 Thread James Cassell
The core team has no interest in taking on more modules. Even the very useful ini_file module is community and preview. For the topic at hand, check out the linux-system-roles project, which is shipped and supported in RHEL as rhel-system-roles. [1] V/r, James Cassell [1] https://github.com/linux-sys

Re: [ansible-project] Switch to root user using dzdo

2020-02-07 Thread James Cassell
dzdo su -", then you should talk to your security folks to get a saner policy. (There's likely hacks that can be done, but "hacks") V/r, James Cassell -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe f

Re: [ansible-project] start servers using ansible playbook

2020-02-03 Thread James Cassell
On Tue, Feb 4, 2020, at 12:03 AM, James Cassell wrote: > On Mon, Feb 3, 2020, at 8:56 PM, Cloud09 wrote: > > Hello Team, > > > > I am writing a playbook to start weblogic servers, could anyone help me > > any syntax errors, I could not make item/item display as it sho

Re: [ansible-project] start servers using ansible playbook

2020-02-03 Thread James Cassell
filepath > - stopservers Instead of loop, I'd recommend with_together. - name: Start the managed server(s) command: "{{item.0}}/{{item.1}}" with_together: - "{{filepath}}" - "{{stopservers}}" V/r, James Cassell -- You received this message because

Re: [ansible-project] Need Help in Ansible regex

2020-01-24 Thread James Cassell
strings here that will never match. You probably meant to do something like when: item is regex('your regex') See for examples: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#testing-strings V/r, James Cassell > with_items: "{{ some_value }}" > &g

Re: [ansible-project] debug msg ignore other results.

2020-01-14 Thread James Cassell
', u'instance_id': > None, u'tenancy': None, u'api_user_key_file': None, > u'api_user_fingerprint': None, u'api_user': None, > u'config_file_location': u'~/.oci/config', u'volume_attachment_id': > None}}, 'changed': False}) => { > "msg": "

Re: [ansible-project] specifying both inventory-file & group from that file

2020-01-13 Thread James Cassell
ts: "{{ ansible_limit }}"` So the playbook runs against the hosts passed to the -l cli option. I've also seen folks swap ansible_limit for target, then force playbook operators to specify -e target=mygroup V/r, James Cassell -- You received this message because you are subscribed to

Re: [ansible-project] Issue with redhat_subscription module

2020-01-13 Thread James Cassell
ity] rc, stderr, stdout = > self.module.run_command(args, check_rc=True) else: > self.module.fail_json(msg='Pool ID: %s not in list of available pools' > % pool_id) return pool_ids > ` > > I was wondering if it should be patched to default quantity to 0 and > includ

Re: [ansible-project] Zeros are truncated from strings. #10281

2019-12-13 Thread James Cassell
dversion: 19.10 > ` You need to make it a string by quoting it; otherwise it's treated as a floating point number. This is yaml behavior. V/r, James Cassell > > However the resulting filename for the above once rendered is "19.1" > Ill confess to not know

Re: [ansible-project] Precendence: why playbook level variables win over inventory ones?

2019-10-19 Thread James Cassell
orgo separating inventory from playbook group_vars. I, too, would be interested in an explanation of why the order is what it is. I've been bitten by it in the past. V/r, James Cassell -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] ansible - shell module using expect

2019-10-08 Thread James Cassell
On Tue, Oct 8, 2019, at 8:58 AM, Troy Cosson wrote: [re-ordered] > > > On Monday, October 7, 2019 at 4:12:36 PM UTC-5, James Cassell wrote:On > Mon, Oct 7, 2019, at 4:19 PM, Troy Cosson wrote: > > > I'm trying to get a Red Hat server (RHEL7) to join a Windows Active &

Re: [ansible-project] ansible - shell module using expect

2019-10-07 Thread James Cassell
> Try \n instead of \r. This is more a question about expect than ansible. You'll also have to worry about special chars in the password, as parsed by TCL. (Obviously you need the expect command available on the target system.) A better approach might be to pass the password in args: stdin and

Re: [ansible-project] unable to Delete post in GitHub ansible community

2019-09-28 Thread James Cassell
uot; folks to trawl the internet for "internal" information, and then take action against the person who "leaked" it. Been there, experienced that.) Hopefully the auto locking can be reconsidered. V/r, James Cassell -- You received this message because you are subscribed to the

Re: [ansible-project] Connection via Citrix

2019-09-24 Thread James Cassell
gn, though I would be interested if you found a way to do it. V/r, James Cassell -- 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.

Re: [ansible-project] More dynamic variables

2019-08-21 Thread James Cassell
es together, including trying the 'vars' lookup > plugin, but I have not been able to work this out after two days of > trying. So, here I am, back at the well, looking for another answer. > Does anyone have any advice? > > V/r, James Cassell -- You received this message becau

Re: [ansible-project] ansible_facts['ansible_os_family'] vs. ansible_facts['os_family']

2019-07-28 Thread James Cassell
hould I delete all leading > "ansible_" from output setup module? Is it documented? > There is an effort to move gathered facts into their own namespace under ansible_facts, dropping the ansible_ prefix on each fact. > > > P.S. also it works even with just: > whe

Re: [ansible-project] Yet another dynamic variable problem

2019-07-23 Thread James Cassell
ference? Why does it work as expected in the debug > task but not in the shell task? > You're doing a double lookup here. Once in with_items and again by using `var` instead of `msg` V/r, James Cassell -- You received this message because you are subscribed to the Google Groups &qu

Re: [ansible-project] ansible playbook in json format not working

2019-06-26 Thread James Cassell
been in '/home/pidansible/test_playbook.json': > >> line 4, column 5, but maybe elsewhere in the file depending on the exact > >> syntax problem. > >> The offending line appears to be: > > > What am I doing wrong and how to run this ? > > Please help. &g

Re: [ansible-project] Enable copr repository with dnf module

2019-05-28 Thread James Cassell
copr module to accomplish that goal, or an extra feature to yum_repository module, however. > Marcin > V/r, James Cassell -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails

Re: [ansible-project] How do command scp -rp in Ansible ?

2019-05-22 Thread James Cassell
task for copy" > copy: > src: /somerepertory/myrepertory1/ > dest: /somerepertory/myrepertory1/ > Use synchronize. There's no support for recursive copy in the copy module. V/r, James Cassell > > But this module do scp -rp or not ? > > Thanks for your a

Re: [ansible-project] Change current directory

2019-05-14 Thread James Cassell
? Maybe try `args: chdir=/mydir` V/r, James Cassell > would you please let me know how can i do change the current directory in > the remote host? > > Kevin > > > > ==

Re: [ansible-project] Re: Rollback in Ansible ?

2019-05-14 Thread James Cassell
e. You should have the rescue block do what is necessary to recover from your SQL script, or use something like a SQL transaction, but, again, it's beyond the scope of ansible. V/r, James Cassell > So what to put in the rescue section? > > Thanks for your help ! :) > > Regards, >

Re: [ansible-project] Rollback in Ansible ?

2019-05-14 Thread James Cassell
; .. > > i want that if one task fails, I want him to go back on all the tasks that > play it. > You can write rollback tasks in a `rescue` section, followed by a fail task, but there is no automatic rollback functionality unless you write it yourself. V/r, James Cassell

Re: [ansible-project] multiline jinja2 lists returned as string?

2019-05-08 Thread James Cassell
\ > {{ cusers.append('other_user') }}\ > {% endif %}\ > {{ cusers }}" Another way: users2: "{{ ['user1', 'users2'] + (ansible_distribution == 'RedHat') | ternary(['redhat_user')], ['other_user']) }}" V/r, James Cassell >

Re: [ansible-project] Ansible Replacing the existing Jar files with new Jar files with same file name is not performing any action

2019-05-01 Thread James Cassell
Please stop the spam. Your message came thru the first time. Also, please don't spam individual members of the list with the same question you sent to the list. Thanks. R, James Cassell On Wed, May 1, 2019, at 9:33 PM, chandrasekhar Mallishetty wrote: > > > On Thursday, May 2,

[ansible-project] Re: How to truncate oracle table with ansible code

2019-05-01 Thread James Cassell
This is a better question for the ansible-project list. V/r, James Cassell On Wed, May 1, 2019, at 4:45 PM, chandrasekhar Mallishetty wrote: > is there any example working code that how to truncate oracle database > table with the ansible code in jinga2 template -- You received this m

Re: [ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-01 Thread James Cassell
ort ANSIBLE_BECOME_PASSWORD=mypassword then in your ansible variables, set: ansible_become_password: "{{ lookup('env', 'ANSIBLE_BECOME_PASSWORD') }}" V/r, James Cassell > On Wed, May 1, 2019 at 3:06 PM James Cassell > wrote: > > > On Wed, May 1, 2019, at 2:55 PM, Guy

Re: [ansible-project] how do I properly set ANSIBLE_BECOME_PASS ?

2019-05-01 Thread James Cassell
On Wed, May 1, 2019, at 2:55 PM, Guy Matz wrote: > Hello! Sorry to be so lame. What combination of environment vars do I > need to set in order to not get prompted for a SUDO password?! > > I've tried setting ANSIBLE_BECOME_PASS and ANSIBLE_ASK_BECOME_PASS=False > but I still get prompted . ..

Re: [ansible-project] [Ansible-project]

2019-04-18 Thread James Cassell
On Thu, Apr 18, 2019, at 9:50 AM, vikram acharya wrote: > Hello Jonathan > > Thanks for support can you help with more detail If possible.. am kind of > new ansible world .. is their any mistake in play book ? > > You need 'gather_facts: yes' V/r, James Cassell >

Re: [ansible-project] var for --ask-pass ?

2019-04-04 Thread James Cassell
On Thu, Apr 4, 2019, at 2:18 AM, sergey.mihai...@gmail.com wrote: > I start playbook : ansible-playbook win_install_ascon.yml --ask-pass > > define in playbook: > ... > ansible_become_pass: "{{ remote_pass }}" ansible_become_password: "{{ ansible_pas

Re: [ansible-project] loop with dynamic item.x

2019-04-01 Thread James Cassell
loop: "{{ nginx }}" > > > This is working well. > > But I need to have the choice of the environment. > > I tried this: > > - debug: > msg: "{{ lookup('vars', 'item.' + environnement }} " msg: "{{ item[environnement] }} &qu

Re: [ansible-project] Re: List of invalid character(s)

2019-03-29 Thread James Cassell
an always do groups.group_name. Just don't call your group "get", "copy", "keys", "items", or a host of other special values... Using "---" as an inventory_hostname is fine, though. V/r, James Cassell -- You received this message because you a

Re: [ansible-project] yum module gives "AttributeError: 'list' object has no attribute 'strip'" on list of items

2019-03-28 Thread James Cassell
omatically install all the packages at once, so there's no warning that ansible will stop doing so in a future release. In any case your playbook will continue to have the same end result as it does today, with our without changes to squash this warning. V/r, James Cassell > task despite that I'm

Re: [ansible-project] Do the target systems need to have pre-requisites installed for Ansible to work?

2019-03-20 Thread James Cassell
uirements are needed on the host that executes this module.” > boto > boto3 > botocore > python >= 2.6 > > > What is “the host that executes this module”? Is this the control host > where you installed Ansible or the remote host that you want to change with > the

Re: [ansible-project] how to prevent Ansible to change ansible_python_interpreter after execution

2019-03-18 Thread James Cassell
o invoke the Ansible command line tool https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html V/r, James Cassell > ```yaml > [default] > localhost ansible_python_interpreter=/Users/cduong/.pyenv/shims/python > ``` > > However, after the execution, Ansibl

Re: [ansible-project] Skip import playbook using when condition.

2019-02-27 Thread James Cassell
n the import are applied to each task imported. V/r, James Cassell > - name: > hosts: rchadm01 > vars_files: > - var.yml > tasks: > - name: > add_host: > name: "{{ decom_host }}" > groups: decom_host_group > > - import_pla

Re: [ansible-project] with blockinfile module, I'm looking for option to check the entries whether its present or not! if not then entries have to be added by play.

2019-02-25 Thread James Cassell
hat it is finding the empty string marker at BOF and finding nothing between the zero length marker and itself, this adding the block unconditionally. You will have more luck with a non empty marker. V/r, James Cassell > > > *Playbook:-* > cat resolv_add.yml > --- > - hosts: resolv

Re: [ansible-project] Re: blockinfile state:absent is not working, I'm trying to remove mulitple lines but not working

2019-02-15 Thread James Cassell
On Fri, Feb 15, 2019, at 8:35 AM, Deepan M wrote: > > Hi James, > > Still same problem! Can you please see below entries and correct me if > anything wrong in that? > > --- > - hosts: xerox > become: yes > tasks: > - name: removelines > blockinfile: > marker_begin:

Re: [ansible-project] blockinfile state:absent is not working, I'm trying to remove mulitple lines but not working

2019-02-15 Thread James Cassell
On Fri, Feb 15, 2019, at 7:45 AM, James Cassell wrote: > > > On Fri, Feb 15, 2019, at 7:25 AM, Deepan M wrote: > > > > please someone help me to get answer for my query! > > > > --- > > - hosts: testuser > > become: yes > > t

Re: [ansible-project] blockinfile state:absent is not working, I'm trying to remove mulitple lines but not working

2019-02-15 Thread James Cassell
You'll need to move your markers from block to marker_begin and marker_end V/r, James Cassell > > ansible-playbook sudolineinfile.yml > SUDO password: > > PLAY [xerox] >

Re: [ansible-project] Version Control playbooks and tasks

2019-02-12 Thread James Cassell
e with > using version control to manage all their playbooks? > I'd hope everyone does. Git is the de facto standard, so go with that unless you have a good reason to use something else. V/r, James Cassell -- You received this message because you are subscribed to the Google Groups &q

Re: [ansible-project] set_fact with_items inside var

2019-02-03 Thread James Cassell
; If I debug the list i get: > > "servers": [ > "[] + [{'ip': {'addr': [item.hostip]", > " 'type': 'V4'}}] + [{'ip': {'addr': [item.hostip]", > " 'type': 'V4'}}] + [{'ip': {'addr': [i

Re: [ansible-project] Re: Unable to parse /etc/ansible/hosts as an inventory source

2019-01-20 Thread James Cassell
eate it first > > e.g. > > sudo mkdir /etc/ansible/ > > sudo touch /etc/ansible/hosts > > sudo chmod 777 /etc/ansible/hosts Pretty sure that making the inventory executable will cause ansible to try to run it as a script then use the output as inventory. V/r, James Cassell

Re: [ansible-project] Beginner, can't complete this step

2019-01-14 Thread James Cassell
, > "msg": "[Errno 13] Permission denied", > "rc": 13 > > > I'm trying to add an user on 4 machines. > -created project directory > -created ansible.cfg file with this content: > [defaults] > remote_user = ansible > host_key_chec

Re: [ansible-project] Re: Using Ansible via a bastion host

2019-01-11 Thread James Cassell
e does not work with complicated connection setups, from my experience. V/r, James Cassell > On Friday, 11 January 2019 18:58:47 UTC, Tim Coote wrote: > > > > I've encountered a couple of modules where target hosts that are accessed > > an intermediate host don't seem t

Re: [ansible-project] "become" not working on centos 7 hosts

2019-01-07 Thread James Cassell
ord is required\r\n", >"msg": "MODULE FAILURE", >"rc": 1 > } It's telling you here that sudo is configured to require a password, but none is being passed. Pass -K on the ansible command line to have ansible prompt you for it. > > &g

Re: [ansible-project] How to use 'with_items' based on variable?

2018-12-28 Thread James Cassell
Try files: "{{ lookup('vars', dir ~ '_files' }}" V/r, James Cassell On Fri, Dec 28, 2018, at 3:03 PM, Bharath Kumar wrote: > Hello Ansible Experts, > > I am creating a Role, which has a task to download multiple files from an > URL, and, for that, I am using get_url

Re: [ansible-project] filtering out attributes

2018-12-21 Thread James Cassell
Look at the json_query filter. You can use it with JMESPath queries to extract what you need. V/r, James Cassell On Fri, Dec 21, 2018, at 6:13 PM, Justin DynamicD wrote: > First I apologize if this was covered elsewhere, but nothing seemed to > match my scenario... at least not in a

Re: [ansible-project] "omit" but for ordinary variables?

2018-12-20 Thread James Cassell
On Thu, Dec 20, 2018, at 1:17 AM, Karl Auer wrote: > Is there anything like the "default(omit)" filter available for ordinary > variable declarations? > > I am building a list of volume details, which will be passed too the ec2 > module. With module parameters, one can comvert an undefined

Re: [ansible-project] how to add ssh host-keys for lots of new cloud hosts?

2018-11-23 Thread James Cassell
Set ansible_ssh_extra_args="-o StrictHostKeyChecking=no" V/r, James Cassell On Thu, Nov 22, 2018, at 6:22 AM, Mark Zhitomirski wrote: > Traditional approach is to leave it to a human operator and warn him of a > new host key. > This way is a no-go for automation and te