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
,
> "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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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:
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]
>
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
; If I debug the list i get:
>
> "servers": [
> "[] + [{'ip': {'addr': [item.hostip]",
> " 'type': 'V4'}}] + [{'ip': {'addr': [item.hostip]",
> " 'type': 'V4'}}] + [{'ip': {'addr': [i
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
>
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
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,
>
? 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
>
>
>
> ==
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
\
> {{ cusers.append('other_user') }}\
> {% endif %}\
> {{ cusers }}"
Another way:
users2: "{{ ['user1', 'users2'] + (ansible_distribution == 'RedHat') |
ternary(['redhat_user')], ['other_user']) }}"
V/r,
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
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 . ..
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
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
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,
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
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
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
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
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
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.
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
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"
>
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
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
&
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
>
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
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
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
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
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
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
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
', 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": "
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
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
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
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
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
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
> 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
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
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
*
> 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
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
> 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
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
64 matches
Mail list logo