Re: [Ext] [ansible-project] Failed to create stack lambda-layer-test5: An error occurred (ValidationError) when calling the CreateStack operation: ParameterValue for ParameterKey Content is required

2024-03-12 Thread 'Rilindo Foster' via Ansible Project
That error is coming from the CloudFormation template, not from the Ansible
code. Review the template and confirm that you are passing all the required
parameter values.

Rilindo

On Tue, Mar 12, 2024 at 6:03 AM kegmysta _devops 
wrote:

> - name: Deploy CloudFormation Stack
> cloudformation:
> stack_name: "{{ stack_name }}"
> state: present
> region: "{{ region }}"
> template: "{{ template }}"
> template_parameters:
> LayerName: "{{ item.1 }}"
> Runtime: "{{ item.0.name }}"
> Content:
> S3Bucket: "{{ s3bucket }}"
> S3Key: "{{ item.0.name }}-{{ item.1 }}-layer.zip"
> disable_rollback: true
> tags:
> Stack: "{{ tags.Stack }}"
> Environment: "{{ tags.Environment }}"
> loop: "{{ lambda_runtimes | subelements('layers') }}"
>
>
>
> Vars:
>
> lambda_runtimes:
> - name: python310
> layers:
> - requests
> - name: python311
> layers:
> - urllib3
> - requests
>
> stack_name: lambda-layer-test5
> template: files/lambda_layer.yml
> s3bucket: twe-enc-common-test-lambdalayer-org
> region: "{{ aws_region }}"
> aws_region: ap-southeast-2
>
>
> tags:
> Stack: stack_name
> Environment: Dev
>
>
> error:
>
> botocore.exceptions.ClientError: An error occurred (ValidationError) when
> calling the CreateStack operation: ParameterValue for ParameterKey Content
> is required
> failed: [localhost] (item=[{'name': 'python310', 'layers': ['requests']},
> 'requests']) => {
> "ansible_loop_var": "item",
> "boto3_version": "1.34.32",
> "botocore_version": "1.34.32",
> "changed": false,
> "error": {
> "code": "ValidationError",
> "message": "ParameterValue for ParameterKey Content is required",
> "type": "Sender"
> },
> "invocation": {
> "module_args": {
> "access_key": null,
> "aws_ca_bundle": null,
> "aws_config": null,
> "backoff_delay": 3,
> "backoff_max_delay": 30,
> "backoff_retries": 10,
> "capabilities": [
> "CAPABILITY_IAM",
> "CAPABILITY_NAMED_IAM"
> ],
> "changeset_name": null,
> "create_changeset": false,
> "create_timeout": null,
> "debug_botocore_endpoint_logs": false,
> "disable_rollback": true,
> "endpoint_url": null,
> "events_limit": 200,
> "notification_arns": null,
> "on_create_failure": null,
> "profile": "twe",
> "region": "ap-southeast-2",
> "role_arn": null,
> "secret_key": null,
> "session_token": null,
> "stack_name": "lambda-layer-test5",
> "stack_policy": null,
> "stack_policy_body": null,
> "stack_policy_on_update_body": null,
> "state": "present",
> "tags": {
> "Environment": "Dev",
> "Stack": "stack_name"
> },
> "template": "files/lambda_layer.yml",
> "template_body": null,
> "template_parameters": {
> "Content": {
> "S3Bucket": "twe-enc-common-test-lambdalayer-org",
> "S3Key": "python310-requests-layer.zip"
> },
>     "LayerName": "requests",
> "Runtime": "python310"
> },
> "template_url": null,
> "termination_protection": null,
> "validate_certs": true
> }
> },
> "item": [
> {
> "layers": [
> "requests"
> ],
> "name": "python310"
> },
> "requests"
> ],
>
>
>
> any help duly appreciated..., its driving me nuts :(
>
>
>
>
>
>
>
>

Re: [ansible-project] selinux issue

2024-02-11 Thread Rilindo Foster
I am not able to reproduce the error, at least with ansible core 2.15.3:

[rilindo@podman01 ~]$ getenforce 
Enforcing
[rilindo@podman01 ~]$ ANSIBLE_KEEP_REMOTE_FILES=1 ansible localhost -m tempfile 
-a "path=/tmp/ prefix=buildproject state=directory" -vvv
ansible [core 2.15.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/rilindo/.ansible/plugins/modules', 
'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.11/site-packages/ansible
  ansible collection location = 
/home/rilindo/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.11.5 (main, Oct 25 2023, 16:19:59) [GCC 8.5.0 20210514 
(Red Hat 8.5.0-20)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its 
verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() 
method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() 
method
Parsed /etc/ansible/hosts inventory source with ini plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: rilindo
<127.0.0.1> EXEC /bin/sh -c 'echo ~rilindo && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo 
/home/rilindo/.ansible/tmp `"&& mkdir "` echo 
/home/rilindo/.ansible/tmp/ansible-tmp-1707699264.9183002-64356-88319939050553 
`" && echo ansible-tmp-1707699264.9183002-64356-88319939050553="` echo 
/home/rilindo/.ansible/tmp/ansible-tmp-1707699264.9183002-64356-88319939050553 
`" ) && sleep 0'
Using module file /usr/lib/python3.11/site-packages/ansible/modules/tempfile.py
<127.0.0.1> PUT 
/home/rilindo/.ansible/tmp/ansible-local-62330a2uwxtzt/tmp001liao1 TO 
/home/rilindo/.ansible/tmp/ansible-tmp-1707699264.9183002-64356-88319939050553/AnsiballZ_tempfile.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x 
/home/rilindo/.ansible/tmp/ansible-tmp-1707699264.9183002-64356-88319939050553/ 
/home/rilindo/.ansible/tmp/ansible-tmp-1707699264.9183002-64356-88319939050553/AnsiballZ_tempfile.py
 && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python3.11 
/home/rilindo/.ansible/tmp/ansible-tmp-1707699264.9183002-64356-88319939050553/AnsiballZ_tempfile.py
 && sleep 0'
localhost | CHANGED => {
"changed": true,
"gid": 1000,
"group": "rilindo",
"invocation": {
"module_args": {
"path": "/tmp/",
"prefix": "buildproject",
"state": "directory",
"suffix": ""
}
},
"mode": "0700",
"owner": "rilindo",
"path": "/tmp/buildproject_zi01c58",
"secontext": "unconfined_u:object_r:user_tmp_t:s0",
"size": 6,
"state": "directory",
"uid": 1000
}

Perhaps it is something that is unique to your local system. Have you been able 
to reproduce in any other system?

- Rilindo

> On Feb 11, 2024, at 5:48 PM, Sergey Glazyrin  
> wrote:
> 
> Here it is
> ANSIBLE_KEEP_REMOTE_FILES=1 ansible localhost -m tempfile -a "path=/tmp/ 
> prefix=buildproject state=directory" -vvv
> And I debugged it, it's not able to get data about selinux context because 
> it's not set, it's triggering OSError with code 61.
> and then it's trying to build up json about failure and it's simply get to 
> the recursion
> 
> 
> понеділок, 12 лютого 2024 р. о 00:36:59 UTC+1 Rilindo Foster пише:
>> That is gnarly. 
>> 
>> Can you provide the play code that attempted to perform this operation?
>> 
>> Rilindo
>> 
>> 
>>> On Feb 11, 2024, at 5:30 PM, Sergey Glazyrin > 
>>> wrote:
>>> 
>> 
>>> Hello guys
>>> I do use linux on local pc and selinux enabled, though there's no context 
>>> for the folders/files/etc
>>> And I am getting following issue:
>>> Recursion error when ansible trying to build the json it failed with.
>>> I am getting it when I am trying to create directory using tempfile module, 
>>> with parameters:
>>>"invocation": {
>>>"module_args": {
>>>"path": "/tmp/",
>>>"prefix": 
>>> "buildproject-Bk4mnluds1J6XoC28KyR0Qz

Re: [ansible-project] selinux issue

2024-02-11 Thread Rilindo Foster
That is gnarly. 

Can you provide the play code that attempted to perform this operation?

Rilindo

> On Feb 11, 2024, at 5:30 PM, Sergey Glazyrin  
> wrote:
> 
> Hello guys
> I do use linux on local pc and selinux enabled, though there's no context for 
> the folders/files/etc
> And I am getting following issue:
> Recursion error when ansible trying to build the json it failed with.
> I am getting it when I am trying to create directory using tempfile module, 
> with parameters:
>"invocation": {
>"module_args": {
>"path": "/tmp/",
>"prefix": "buildproject-Bk4mnluds1J6XoC28KyR0QzUgSVVpgSJBxQ7JlWf",
>"state": "directory",
>"suffix": ""
>}
>},
> Traceback:
> File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 679, in selinux_context
>self.fail_json(path=path, msg='failed to retrieve selinux context') 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1531, in fail_json 
>self._return_formatted(kwargs) 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1459, in _return_formatted 
>self.add_path_info(kwargs) 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1212, in add_path_info 
>kwargs['secontext'] = ':'.join(self.selinux_context(path)) 
>   ^^ 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 679, in selinux_context 
>self.fail_json(path=path, msg='failed to retrieve selinux context') 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1531, in fail_json 
>self._return_formatted(kwargs) 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1459, in _return_formatted 
>self.add_path_info(kwargs) 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1212, in add_path_info 
>kwargs['secontext'] = ':'.join(self.selinux_context(path)) 
>   ^^ 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 679, in selinux_context 
>self.fail_json(path=path, msg='failed to retrieve selinux context') 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1531, in fail_json 
>self._return_formatted(kwargs) 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1459, in _return_formatted 
>self.add_path_info(kwargs) 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 1212, in add_path_info 
>kwargs['secontext'] = ':'.join(self.selinux_context(path)) 
>   ^^ 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/basic.py",
>  line 674, in selinux_context 
>ret = selinux.lgetfilecon_raw(to_native(path, 
> errors='surrogate_or_strict')) 
>  
> ^^ 
>  File 
> "/tmp/ansible_tempfile_payload_qfnjn5co/ansible_tempfile_payload.zip/ansible/module_utils/compat/selinux.py",
>  line 95, in lgetfilecon_raw 
>rc = _selinux_lib.lgetfilecon_raw(path, byref(con)) 
> ^^ 
> ctypes.ArgumentError: argument 1: RecursionError: maximum recursion depth 
> exceeded 
> fatal: [127.0.0.1]: FAILED! => { 
>"changed": false, 
>"invocation": { 
>"module_args": { 
>"path": "/tmp/", 
>"prefix": "buildproject-Bk4mnluds1J6XoC28KyR0QzUgSVVpgSJBxQ7JlWf", 
>"state": "directory", 
>"suffix": "" 
>} 
>}, 
>"msg": "argument 1: RecursionError: maximum recursion depth exceeded" 
> }
> 
> 
> -- 
> 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/67c6896e-8cd1-455b-af11-280f666d2bfbn%40googlegroups.com
>  
> .

-- 
You received this message because you are 

Re: [ansible-project] [ansible project] VM snapshot capture using VMware

2024-01-21 Thread Rilindo Foster
Is that a space before snapshot (right where it says “Task” in the JSON request)? Was that part of the request or did you insert that by mistake when you copied it into the email?- RilindoOn Jan 21, 2024, at 9:13 PM, Prady A  wrote:Hi,Thank you both of you for your kind suggestions.We are using leap-upgrade tool to upgrade. In upgrade there is no issue. We have a health checkup also post upgrade.The issue is in VMware but not sure when creating manually the “Snapshot the virtual machine memory” is set to Yes but when I am creating the snapshot through ansible automatically it is setting as No. This is something with VMware maybe.. - Name: Create VM snapshot   Uri:       URL: https://api.xyz/virtualization/snapshot/snow      User: “ {{ snapshot_user }}”      Password: “{{ snapshot_Password }}“      force_basic_auth: true      Method: post       Body_format: json      Body: |-          {             “Hostname”: “{{ vm_hostname }}”,             “Task”: “ create”,              “Snapshot_name”: “upgrade-{{vm_hostname}} “           }      Status code: 202   Register: snapshot_resultRegards PD   On Sun, 21 Jan 2024 at 07:15, Nico Kadel-Garcia  wrote:On Thu, Jan 18, 2024 at 8:16 PM Prady A  wrote:
>
> Hi experts,
>
> We are doing automation to update RHEL7-> RHEL8 .
> Before we upgrade we take the snapshot.
> The issue is whenever there is an upgrade failure we revert the server to its previous state. But it seems when we revert it the machine is in power off state..
> it seems when we take automatic snapshot it happens like that.. Any pointers pls
>
> Regards
> PD

That's a RHEL problem. It's not an operation supported by RHEL.
Updating the critical system libraries, such as glibc and the python
on which RPM is based, and RPM itself, is likely to trip over a *lot*
of problems without quite a lot of research and debugging. From
decades of experience with Red Hat based operating systems, I
recommend very strongly against this approach.

If I may suggest, take a disk image of the old system and build a new
system, with content copied as needed to configure the new system.

-- 
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/CAOCN9ry6d0wKwzJutwXDJSMH3X9vD51hLVqqtbJd9rHzRfkEKQ%40mail.gmail.com.




-- 
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/CAEuB3AoFvdepBuNSvKHQ%3Dc_TYpwUUjrF8QYdgMd_MKb22-8v8A%40mail.gmail.com.




-- 
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/5C29FCDA-9E8E-43D0-B343-46D172B5EF4F%40gmail.com.


Re: [ansible-project] [ansible project] VM snapshot capture using VMware

2024-01-18 Thread Rilindo Foster
Hi!

It is not clear how this is an Ansible issue. Can you provide the playbook or 
role code you use to accomplish this?

- Rilindo

> On Jan 18, 2024, at 7:16 PM, Prady A  wrote:
> 
> Hi experts,
> 
> We are doing automation to update RHEL7-> RHEL8 .
> Before we upgrade we take the snapshot. 
> The issue is whenever there is an upgrade failure we revert the server to its 
> previous state. But it seems when we revert it the machine is in power off 
> state.. 
> it seems when we take automatic snapshot it happens like that.. Any pointers 
> pls
> 
> Regards 
> PD
> 
> -- 
> 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/CAEuB3Ao_J9xpBd3D8pqcFdj%2B30%3DpobvtHJDbceWXbX0xh9cHWg%40mail.gmail.com
>  
> .

-- 
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/96C32CC9-B9EF-447B-BE32-373287D4B038%40gmail.com.


Re: [ansible-project] Simple lineinfile, but make it idempotent

2023-11-13 Thread Rilindo Foster
Hi Chad,

I think you are on the right track. If you can read the file into memory, you 
should be able to grep to confirm if the entry exists in file or not before 
actually making the change.

https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_conditionals.html#conditions-based-on-registered-variables

> On Nov 13, 2023, at 12:45 PM, Schrock, Chad - 0336 - MITLL 
>  wrote:
> 
>  
> Hi everyone,
>  
> I am really having a very Monday Monday today and am just having a fit with 
> my regex. I’m working on implementing part of the DISA STIG for RHEL 9 and 
> need to edit /etc/bashrc, specifically:
>  
> # Set default umask for non-login shell only if it is set to 0
> [ `umask` -eq 0 ] && umask 022
>  
> I need to change that “umask 022” to “umask 077” and I’ve gotten as far as 
> this:
>  
> - name: RHEL-09-412055 | RHEL 9 must define default permissions for the bash 
> shell
>   ansible.builtin.lineinfile:
> path: /etc/bashrc
> regexp: \sumask\s\d{3}
> line: "[ `umask` -eq 0 ] && umask 077"
>  
>  
> But then realized that the regexp and replacement isn’t idempotent and since 
> then my brain has just decided to go on a little vacation by itself.
>  
> I was thinking about some sort of capture group and then something saying “if 
>  != ‘077’,” but I think I completely lost the plot at that 
> point.
>  
> Thank you for any help on this Mondayest of Mondays.
>  
>  
>  
> --
> Chad Schrock, he/him
> Supporting MIT Lincoln Laboratory, Lexington, MA
>  
> 
> -- 
> 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/PH1P110MB14443DB4A6FBB2E6DD135DA8B3B3A%40PH1P110MB1444.NAMP110.PROD.OUTLOOK.COM
>  
> .

-- 
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/BFFD37BC-20E6-4186-90E5-D1BC9930E3ED%40gmail.com.


Re: [ansible-project] Terraform support

2023-11-02 Thread Rilindo Foster
Hi Thirumalai,

It looks like you can:

https://docs.ansible.com/ansible/latest/collections/community/general/terraform_module.html


The examples documented here seems straightforward, so I think you should be 
able to get it working with those.

Rilindo

> On Nov 2, 2023, at 12:53 PM, Thirumalai Raja A  
> wrote:
> 
> Hi folks,.
> 
> I have terraform code to deploy VM on vsphere Environment can we do the 
> deployment using ansible Terraform module,if can how will it work is it will 
> work like as we deploy using terraform.
> 
> If anyone use this function can you please provide me the examples
> 
> 
> Regards,
> Thirumalai.
> 
> -- 
> 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/CALyK%3Dg-TfooJC0MLQfA%2BuEiHFZwe6HrNXWKvj3RrW9zd-z_VTQ%40mail.gmail.com
>  
> .

-- 
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/4EFBEDD1-41F1-4A54-BC64-7720247ACB0B%40gmail.com.


Re: [ansible-project] Ansible playbook undefined variable

2023-08-09 Thread Rilindo Foster
Hi Hernan,

Your variable is actually a data structure of a list of dictionary:

admin:
  - name: 'herlit_semaphore'
comment: 'Ultimate User'
uid: '1000'

  - name: 'semaphore'
comment: 'Semaphore App User'
uid: '1001'



If you don’t intend to do loop, you simply reference the item directly. For 
example, for “herlit_semaphore” user, you do:

- name: Add the user with a specific uid and a primary group of "admin"
  ansible.builtin.user:
name: "{{ admin[0].name }}"
comment: "{{ admin[0].comment }}"
uid: "{{ admin[0].uid }}"
state: present
group: admin
append: yes

Where [0] is the first element in the list that contains that user. For the 
second user, it is going to be:


- name: Add the user "semaphore" with a specific uid and a primary group of 
"admin"
  ansible.builtin.user:
name: "{{ admin[1].name }}"
comment: "{{ admin[1].comment }}"
uid: "{{ admin[1].uid }}"
state: present
group: admin
append: yes


Where [1] is the second element in the list and th one that contains the 
“semaphore” user.

You can confirm the placement by pasting:

admin:
  - name: 'herlit_semaphore'
comment: 'Ultimate User'
uid: '1000'

  - name: 'semaphore'
comment: 'Semaphore App User'
uid: ‘1001'

Into:


https://jsonformatter.org/yaml-viewer
Best YAML Viewer Online
jsonformatter.org

And click on “YAML Viewer” to browse around the list.

Note that unless there is a good reason, it would be better to loop around that 
data structure, as it mean much less code.

- Rilindo


> On Aug 9, 2023, at 3:05 PM, Hernan Sal  wrote:
> 
> Hi,
> I'm running an ansible playbook called create_admin_user.yml and I'm getting
> this error
> 
> fatal: [172.31.3.117]: FAILED! => {"msg": "The task includes an option with 
> an undefined variable. The error was: 'herlit_semaphore' is undefined. 
> 'herlit_semaphore' is undefined\n\nThe error appears to be in 
> '/etc/ansible/roles/create_admin_user/tasks/main.yml': line 13, column 3, but 
> may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe 
> offending line appears to be:\n\n\n- name:  semaphore\n  ^ here\n"}
> 
> This is my create_admin_user.yaml file in  the playbooks/users directory
> - hosts: all
>   gather_facts: yes
>   become: yes
>   become_user: root
>   tasks:
> - ansible.builtin.import_role:
> name: create_admin_user
> 
> This is my main.yml in the vars directory
> admin:
>   - name: 'herlit_semaphore'
> comment: 'Ultimate User'
> uid: '1000'
> 
>   - name: 'semaphore'
> comment: 'Semaphore App User'
> uid: '1001'
> 
> This is my main.yml in the tasks directory
> ---
> # tasks file for create_admin_user
> 
> - name: Add the user with a specific uid and a primary group of "admin"
>   ansible.builtin.user:
> name: "{{ herlit_semaphore.name }}"
> comment: "{{ herlit_semaphore.comment }}"
> uid: "{{ herlit_semaphore.uid }}"
> state: present
> group: admin
> append: yes
> 
> - name: Add the user "semaphore" with a specific uid and a primary group of 
> "admin"
>   ansible.builtin.user:
> name: "{{ semaphore.name }}"
> comment: "{{ semaphore.comment }}"
> uid: "{{ semaphore.uid }}"
> state: present
> group: admin
> append: yes
> 
> Sorry for the long email. Any ideas about this error?
> THanks
> Hernan
> 
> -- 
> 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/269931b4-2003-41cf-8321-7e04ac730488n%40googlegroups.com
>  
> .

-- 
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/711AE5BA-19B9-4C8D-9CB2-1B69D2FD636A%40gmail.com.


Re: [Ext] Re: [ansible-project] Issue with Ruby version on target system

2023-07-31 Thread Rilindo Foster
Being somewhat familiar with rvm, has the gem binary been (sym)linked to
the version of ruby deployed with rvm? Alternatively, you can probably set
the executable attribute to point to an explicit path of the gem binary (as
opposed to defaulting to /bin/gem)

On Sat, Jul 29, 2023 at 7:31 PM lift...@gmail.com 
wrote:

> Here's the section of the role:
>
> - name: Install latest Bundler gem
>   ansible.builtin.gem:
> name: bundler
> state: present
> user_install: false
> executable: /bin/gem
>   changed_when: false
>
>
> Thanks,
> Harry
> On Friday, July 28, 2023 at 5:57:23 PM UTC-4 Dick Visser wrote:
>
>> Without seeing any tasks or plays that would be hard.
>>
>> On Fri, 28 Jul 2023 at 21:31, lift...@gmail.com 
>> wrote:
>>
>>> I have a role that will install Redmine onto a RHEL 8 system.  When I
>>> run the playbook and it tries to install "bundler", I get the following
>>> error:
>>>
>>> ERROR:  Error installing bundler:
>>> bundler requires Ruby version >= 2.6.0. The current ruby version is
>>> 2.5.0.
>>>
>>> I have installed Ruby 2.7.8 on the target system using rvm, but I still
>>> get that error.  How can I have the playbook recognize that Ruby 2.7.8 is
>>> installed and the default to eliminate this error?
>>>
>>> Thanks,
>>> Harry
>>>
>>> --
>>> 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-proje...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/f63f28aa-2e8f-4980-8b41-4b2c3da4117cn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/f63f28aa-2e8f-4980-8b41-4b2c3da4117cn%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>> --
>> Sent from Gmail Mobile
>>
> --
> 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/67deb9f2-10eb-4ce3-829a-1593f7d3195an%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/67deb9f2-10eb-4ce3-829a-1593f7d3195an%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 
---
Rilindo Foster - DevOps
fost...@nextcapital.com
NextCapital Group, Inc.
104 S. Michigan Avenue, Suite 1400
Chicago, IL  60603-5958

-- 
*NextCapital is a subsidiary of Goldman Sachs Asset Management and part of 
The Goldman Sachs Group, Inc. All rights reserved.*
See 
http://www.gs.com/disclaimer/global_email 
<http://www.gs.com/disclaimer/global_email> for important risk disclosures, 
conflicts of interest and other terms and conditions relating to this 
e-mail and your reliance on information contained in it.  This message may 
contain confidential or privileged information.  If you are not the 
intended recipient, please advise us immediately and delete this message. 
See http://www.gs.com/disclaimer/email <http://www.gs.com/disclaimer/email> 
for further information on confidentiality and the risks of non-secure 
electronic communication.  If you cannot access these links, please notify 
us by reply message and we will send the contents to you.
 

-- 
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/CALyV05THmO-hRR0H%3D11%3Dtw8Ry7iFfWrSsd4GZ_DX%2BLngtZOsmQ%40mail.gmail.com.


Re: [ansible-project] Failed to install package NTP

2023-07-23 Thread Rilindo Foster
If OP is using actual Red Hat, they can directly install it via dnf/yum

https://access.redhat.com/articles/3050101
Red Hat Enterprise Linux (RHEL) System Roles - Red Hat Customer Portal
access.redhat.com


> On Jul 23, 2023, at 11:51 AM, Richard Megginson  wrote:
> 
> If you need to manage time synchronization on an EL system (RHEL6-RHEL9, 
> CentOS, Fedora) then I strongly encourage you to use the timesync system role 
> https://github.com/linux-system-roles/timesync/, available in the 
> fedora.linux_system_roles collection 
> https://galaxy.ansible.com/fedora/linux_system_roles, and maintained by 
> Miroslav Lichvar, the maintainer of chrony - this will take care of 
> installing the right packages, managing the right services, etc.
> 
> On Sun, Jul 23, 2023 at 9:37 AM Thanh Nguyen Duc  > wrote:
>> Try it locally by command: yum install ntpd or chrony or dnf install chrony 
>> ansible just help you to install it remotely. The error come from your local 
>> host.
>> 
>>> On 23 Jul 2023, at 22:36, arjungoel 1995 >> > wrote:
>>> 
>>> 
>>> I have tried Chrony as well but same issue persists.
>>> 
>>> On Sun, Jul 23, 2023 at 1:15 AM Todd Lewis >> > wrote:
 Maybe chrony rather than ntp? What OS is your target host running?
 
 On Saturday, July 22, 2023 at 3:27:11 PM UTC-4 arjungoel 1995 wrote:
> Hi, I was just testing a basic playbook in Ansible. Here is the playbook 
> code:
> 
> ---
> - name: Set up NTP on all servers
>   hosts: all
>   become: true
>   tasks:
> - name: Ensure NTP is installed
>   yum: 
> name: ntp 
> state: present
> - name: Ensure NTP is running
>   service: 
> name: ntpd 
> state: started 
> enabled: yes
> 
> 
> When I am running the ansible-playbook playbook.yaml command, I am 
> getting this error:
> 
> TASK [Ensure NTP is installed] 
> 
> fatal: [3.226.126.95]: FAILED! => {"changed": false, "failures": ["No 
> package ntp available."], "msg": "Failed to install some of the specified 
> packages", "rc": 1, "results": []}
> 
> PLAY RECAP 
> 
> 3.226.126.95   : ok=1changed=0unreachable=0
> failed=1skipped=0rescued=0ignored=0   
> 
> 
> 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/b2c97345-e157-492e-bcff-a345002060d2n%40googlegroups.com
  
 .
>>> 
>>> 
>>> -- 
>>> 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/CALh2VPJkCPS4wjJMq967LD9HpfeH7FaQ8-%3DXL2CAkrnbuHDQtw%40mail.gmail.com
>>>  
>>> .
>> 
>> 
>> -- 
>> 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/5592C7E5-287F-472E-B6D8-0A82DA794574%40gmail.com
>>  
>> .
> 
> 
> -- 
> 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 
> 

Re: [ansible-project] Failed to install package NTP

2023-07-22 Thread Rilindo Foster
Given that the OP is using YUM resource, very likely a RHEL-like distribution, 
which certainly meant RHEL 8, since the NTP daemon appears to be no longer 
supported in that version.

> On Jul 22, 2023, at 2:45 PM, Todd Lewis  wrote:
> 
> Maybe chrony rather than ntp? What OS is your target host running?
> 
> On Saturday, July 22, 2023 at 3:27:11 PM UTC-4 arjungoel 1995 wrote:
>> Hi, I was just testing a basic playbook in Ansible. Here is the playbook 
>> code:
>> 
>> ---
>> - name: Set up NTP on all servers
>>   hosts: all
>>   become: true
>>   tasks:
>> - name: Ensure NTP is installed
>>   yum: 
>> name: ntp 
>> state: present
>> - name: Ensure NTP is running
>>   service: 
>> name: ntpd 
>> state: started 
>> enabled: yes
>> 
>> 
>> When I am running the ansible-playbook playbook.yaml command, I am getting 
>> this error:
>> 
>> TASK [Ensure NTP is installed] 
>> 
>> fatal: [3.226.126.95]: FAILED! => {"changed": false, "failures": ["No 
>> package ntp available."], "msg": "Failed to install some of the specified 
>> packages", "rc": 1, "results": []}
>> 
>> PLAY RECAP 
>> 
>> 3.226.126.95   : ok=1changed=0unreachable=0failed=1  
>>   skipped=0rescued=0ignored=0   
>> 
>> 
>> 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/b2c97345-e157-492e-bcff-a345002060d2n%40googlegroups.com
>  
> .

-- 
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/51140E56-277A-4F6C-BB60-2F29AA0F7082%40gmail.com.


Re: [ansible-project] Regarding Citrix Support for Ansible

2023-05-03 Thread Rilindo Foster
Hi Amit,

Can we get some clarification – are you asking for whether you can use Ansible 
with Citrix console, or help with having Ansible terminating hung user 
sessions? Or Is the issue that you want able to do tasks with Ansible through 
Citrix?


  *   Rilindo

From: ansible-project@googlegroups.com  on 
behalf of Amit Kulkarni 
Date: Wednesday, May 3, 2023 at 1:16 PM
To: ansible-project@googlegroups.com 
Subject: Re: [ansible-project] Regarding Citrix Support for Ansible
Currently we are doing it manually.

Regards
Amit

On Wed, May 3, 2023 at 2:14 PM Dick Visser 
mailto:dnmvis...@gmail.com>> wrote:
Could you tell us how you do this currently?

On Wed, 3 May 2023 at 20:02, Amit Kulkarni 
mailto:amit1811...@gmail.com>> wrote:
Hello Sir,

Appreciate any help or pointers around this.

Regards
Amit

On Wed, May 3, 2023 at 1:54 PM Dick Visser 
mailto:dnmvis...@gmail.com>> wrote:
How would you do such a thing without ansible?

On Wed, 3 May 2023 at 19:35, Amit Kulkarni 
mailto:amit1811...@gmail.com>> wrote:
Hello All,

I am looking for help where we have T1 Citrix Console and in that User sessions 
get hung & those hung sessions need to be killed.

Is there any way we can achieve this with Ansible?

I tried to look it up but unable to find any information, appreciate your help 
on this.

Regards
Amit
--
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/CAON3ZR1fBZZMr%2BTjkXiM2D4O3JH2d9nZsKJBioNdt4KM4WV5Pg%40mail.gmail.com.
--
Sent from Gmail Mobile
--
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/CAF8BbLa0SFbdn4FQ-tJ3B9PqDtjNidLjPxrb470R1y1PUxnzWA%40mail.gmail.com.
--
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/CAON3ZR35fXW0XpTVST9dnBJE%3DyyLmaRNBAFB0Dy4TAbEmhTvvg%40mail.gmail.com.
--
Sent from Gmail Mobile
--
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/CAF8BbLadeaR6AXNRAFtKm-qCdWj-LYd%2BLmL86kvTVZ746RYmSQ%40mail.gmail.com.
--
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/CAON3ZR1MMtGDr3ssKT3JNo_CYyzhRCns-FwVoJg4JRdiZ7_8PA%40mail.gmail.com.

-- 
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/DM6PR12MB31489C172C64FD6FD4F2EA6EF16C9%40DM6PR12MB3148.namprd12.prod.outlook.com.


Re: [ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread Rilindo Foster
You probably won’t be able to upgrade as long as you are using Python 2.7. You 
will have to figure out a way to get a newer version of Python on the machine 
if you intend to upgrade to the most recent version of Ansible.

- Rilindo

> On Jul 25, 2022, at 7:46 PM, SARANSH BANKIWAL  
> wrote:
> 
> Hi , thanks for the prompt response, 
> I read the article previously as well but was not able to install Ansible to 
> a version of 5 or above because of less available resources. Can you please 
> help in the same. 
> Thanks in advance.
> 
> On Tuesday, July 26, 2022 at 5:55:09 AM UTC+5:30 ril...@gmail.com wrote:
> Hi Saransh,
> 
> I am going to guess that it has to do with your version of ansible as it 
> appears 2.9 does not yet support  IMDS v2, where as latest version (at least 
> 5 and above) doesdoes, as noted in this link:
> 
> "The module is configured to utilize the session oriented Instance Metadata 
> Service v2 (IMDSv2) 
> https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
>  
> ."
> 
> https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_metadata_facts_module.html
>  
> 
> https://docs.ansible.com/ansible/5/collections/amazon/aws/ec2_metadata_facts_module.html
>  
> 
> 
> 
> - Rilindo
> 
> 
>> On Jul 25, 2022, at 7:11 PM, SARANSH BANKIWAL > > wrote:
>> 
> 
>> Hello all, 
>> Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and got 
>> the below error. 
>> FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from AWS: 
>> HTTP Error 401: Unauthorized", "response": {"body": "> encoding=\"iso-8859-1\"?>\n> Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
>>  \">\n> xmlns=\"http://www.w3.org/1999/xhtml\ " 
>> xml:lang=\"en\" lang=\"en\">\n \n  401 - Unauthorized\n 
>> \n \n  401 - Unauthorized\n \n\n", 
>> "connection": "close", "content-length": "343", "content-type": "text/html", 
>> "date": "Mon, 25 Jul 2022 23:26:11 GMT", "msg": "HTTP Error 401: 
>> Unauthorized", "server": "EC2ws", "status": 401, "url": 
>> "http://169.254.169.254/latest/meta-data/ 
>> "}}
>> 
>> My ansible version on this Instance is : (ansible --version)
>> 
>> ansible 2.9.15
>> config file = /etc/ansible/ansible.cfg
>> configured module search path = [u'/root/.ansible/plugins/modules', 
>> u'/usr/share/ansible/plugins/modules']
>> ansible python module location = /usr/lib/python2.7/dist-packages/ansible
>> executable location = /usr/bin/ansible
>> python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]
>> 
>> Can someone please in this as stuck on this.
>> Thanks in advance. 
>> 
>> 
> 
>> -- 
>> 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-proje...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d6328c61-380e-4c9d-b043-2203d81385a5n%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> 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/9207373f-4a95-49a1-8894-e8e8ee79d81en%40googlegroups.com
>  
> .

-- 
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/9464E7B0-EB20-47C8-8950-41159F01B04E%40gmail.com.


Re: [ansible-project] IMDS V2 Unauthorised Error || Guidance Required

2022-07-25 Thread Rilindo Foster
Hi Saransh,

I am going to guess that it has to do with your version of ansible as it 
appears 2.9 does not yet support  IMDS v2, where as latest version (at least 5 
and above) doesdoes, as noted in this link:

"The module is configured to utilize the session oriented Instance Metadata 
Service v2 (IMDSv2) 
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html
 
."

https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_metadata_facts_module.html
 

https://docs.ansible.com/ansible/5/collections/amazon/aws/ec2_metadata_facts_module.html
 



- Rilindo

> On Jul 25, 2022, at 7:11 PM, SARANSH BANKIWAL  
> wrote:
> 
> Hello all, 
> Currently i was working on migration from IMDS v1 to IMDS v2 in AWS and got 
> the below error. 
> FAILED! => {"changed": false, "msg": "Failed to retrieve metadata from AWS: 
> HTTP Error 401: Unauthorized", "response": {"body": " encoding=\"iso-8859-1\"?>\n Transitional//EN\"\n\t\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\;>\n  xmlns=\"http://www.w3.org/1999/xhtml\; xml:lang=\"en\" lang=\"en\">\n 
> \n  401 - Unauthorized\n \n \n  401 - 
> Unauthorized\n \n\n", "connection": "close", 
> "content-length": "343", "content-type": "text/html", "date": "Mon, 25 Jul 
> 2022 23:26:11 GMT", "msg": "HTTP Error 401: Unauthorized", "server": "EC2ws", 
> "status": 401, "url": "http://169.254.169.254/latest/meta-data/"}}
> 
> My ansible version on this Instance is : (ansible --version)
> 
> ansible 2.9.15
> config file = /etc/ansible/ansible.cfg
> configured module search path = [u'/root/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
> ansible python module location = /usr/lib/python2.7/dist-packages/ansible
> executable location = /usr/bin/ansible
> python version = 2.7.17 (default, Jul  1 2022, 15:56:32) [GCC 7.5.0]
> 
> Can someone please in this as stuck on this.
> Thanks in advance. 
> 
> 
> -- 
> 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/d6328c61-380e-4c9d-b043-2203d81385a5n%40googlegroups.com
>  
> .

-- 
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/25527E49-8CFA-41AF-9FBE-801037F79E8A%40gmail.com.


Re: [ansible-project] Execute Ansible playbooks in Terraform main.tf file

2022-07-23 Thread Rilindo Foster
Hi Kaushal,

You would want to review the Terraform documentation for 
google_compute_instance - likely metadata_startup_script is your answer:

https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#metadata_startup_script

Any more this goes beyond the scope of this mailing list, so I would recommend 
reaching to appropriate Hashicorp or GCP resources for more help.

- Rilindo

> On Jul 23, 2022, at 11:04 AM, kaushal...@gmail.com  
> wrote:
> 
> Hi Rilindo,
> 
> I am using Google Cloud Platform (GCP) - Google Cloud as my primary cloud 
> service provider. Please guide. Thanks in advance.
> Best Regards,
> 
> Kaushal
> 
> On Saturday, 23 July 2022 at 21:30:59 UTC+5:30 kaushal...@gmail.com 
>  wrote:
> Thanks Rilindo for the quick response and much appreciated. I will appreciate 
> if you can provide me with a basic working example to understand it and I 
> will implement it once i play around with it. Thanks in Advance.
> 
> Best Regards,
> 
> Kaushal
> 
> On Saturday, 23 July 2022 at 21:13:43 UTC+5:30 ril...@gmail.com 
>  wrote:
> Hi Kausal,
> 
> Depending on the provider, you can use cloud-init to:
> 
> - Invoke an installation of Ansible
> - Download the Ansible code
> - Run the code from a local installed instance of Ansible
> 
> - Rilindo
> 
> 
>> On Jul 23, 2022, at 10:22 AM, kaushal...@gmail.com  
>> > wrote:
>> 
> 
>> Hi,
>> 
>> Is there a way to execute Ansible playbooks in Terraform main.tf 
>>  file? For example I want to deploy nginx webserver inside 
>> GCP GCE VM Instance using Ansible playbook once GCP GCE VM Instance is 
>> provisioned using Terraform.
>> 
>> Please guide. Thanks in advance.
>> 
>> Best Regards,
>> 
>> Kaushal
>> 
>> 
> 
>> -- 
>> 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-proje...@googlegroups.com <>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/d3e76019-0911-4577-a9e4-85575eb885a5n%40googlegroups.com
>>  
>> .
> 
> 
> -- 
> 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/2243341d-81a5-4671-98b9-8e3a10ec1298n%40googlegroups.com
>  
> .

-- 
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/071E98BF-0FE3-4AFC-A59B-787DF78C4DD8%40gmail.com.


Re: [ansible-project] Execute Ansible playbooks in Terraform main.tf file

2022-07-23 Thread Rilindo Foster
Hi Kausal,

Depending on the provider, you can use cloud-init to:

- Invoke an installation of Ansible
- Download the Ansible code
- Run the code from a local installed instance of Ansible

- Rilindo

> On Jul 23, 2022, at 10:22 AM, kaushal...@gmail.com  
> wrote:
> 
> Hi,
> 
> Is there a way to execute Ansible playbooks in Terraform main.tf file? For 
> example I want to deploy nginx webserver inside GCP GCE VM Instance using 
> Ansible playbook once GCP GCE VM Instance is provisioned using Terraform.
> 
> Please guide. Thanks in advance.
> 
> Best Regards,
> 
> Kaushal
> 
> 
> -- 
> 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/d3e76019-0911-4577-a9e4-85575eb885a5n%40googlegroups.com
>  
> .

-- 
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/3C809756-8BCE-4F7D-9E6B-E95AB4BF6361%40gmail.com.


Re: [Ext] [ansible-project] RHCE exam question

2022-07-11 Thread Rilindo Foster
Hi Mahdi!

Red Hat NDA actually prohibits you from discussing specific exam questions and 
can result in you and other people being banned from future exams as well as 
revocation of any Red Hat you may have already obtained. 

I would recommend not bringing up exam specific questions in the future.

—
Rilindo Foster - Cloud Reliability Architect
fost...@nextcapital.com
NextCapital Group, Inc.
104 S. Michigan Avenue, Suite 1400
Chicago, IL  60603-5958

> On Jul 11, 2022, at 3:59 AM, Mahdi Idriss  wrote:
> 
> Hi guys,
> 
> I had this question on my last ex294 ansible exame, so I was not able to 
> solve it, anyone have the right playbook or can create one?
> 
> Create a playbook called roles. yml with requirements:
> · The playbook contains a play that runs on hosts in the balancers 
> host group and uses the balancer role:
> 1.   This role configures a service to load balance web server requests 
> between hosts in the webservers host group
> 2.   Browsing to hosts in the balancers host group (example: 
> http://node5. <http://node5./>..com) produces the output: Welcome message 
> on 192.168.1.10
> 3.   Reloading the browser produces output from the alternate web server: 
> Welcome message on 192.168.1.11
> ·  
> · The playbook contains a play that runs on hosts in the webservers 
> host group and uses the phpinfo role:
> 1.   Browsing to hosts in the webservers host group with the URL  /hello 
> .php produces the following output: Hello  PHP World  from {{ansible_fqdn}}
>  
> 2.For ex:  browsing to http://node3com/hello.php, produces the 
> following output: Hello PHP World from node3…...com (Note: along with various 
> details of the PHP configuration including the version of PHP that is 
> installed)
>  
>  
> 3.   Similarly browsing to http://node4com/hello.php. produces the 
> following output: Hello PHP World from node4…...com (Note: along with various 
> details of the PHP configuration including the version of PHP that is 
> installed.)
> 
> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CADHi4Y8%3DP7BuZLLStqELaac3jn7_Jh%2BZYT68xFEmmjTcwFvZJA%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/ansible-project/CADHi4Y8%3DP7BuZLLStqELaac3jn7_Jh%2BZYT68xFEmmjTcwFvZJA%40mail.gmail.com?utm_medium=email_source=footer>.


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/F5B75710-B69F-4F17-B598-53D6D2A8DF5C%40nextcapital.com.


Re: [ansible-project] Ansible galaxy Role

2022-06-18 Thread Rilindo Foster
HI there,

You probably won’t get any direct answers on this, since Red Hat exams are 
under NDA. I will say that most tasks in question will provide enough detail 
that you should be able to complete the objective. So the next time you take 
the test, review environment and tasks carefully.

- Rilindo

> On Jun 18, 2022, at 11:51 AM, Rock  wrote:
> 
> Actually my question is from my last try for RHCE 294 Exam, and i was not 
> able to solve it,
> anyway thanks for all of you 
> 
> On Saturday, June 18, 2022 at 8:01:01 PM UTC+4 Abhijeet Kasurde wrote:
> I found this 
> https://galaxy.ansible.com/dipuyadav/configure_httpd_with_haproxy_role 
> , I 
> never tried it myself, but you can take a look.
> 
> On Sat, Jun 18, 2022 at 9:09 PM Paul Manno  > wrote:
> Are you trying to write an ansible playbook that runs as a service to load 
> balance backends? That's not how ansible works. Sounds like you need a load 
> balancer like nginx or haproxy. 
> 
> Sent from my T-Mobile 5G Device
> Get Outlook for Android 
> From: ansible...@googlegroups.com 
>  
>  > on behalf of Abhijeet 
> Kasurde  >
> Sent: Saturday, June 18, 2022 9:04:17 AM
> To: ansible...@googlegroups.com 
>  
>  >
> Subject: Re: [ansible-project] Ansible galaxy Role
>  
> What is the question?
> 
> On Sat, Jun 18, 2022 at 5:34 PM Mahdi Idriss  > wrote:
> Hello Mates, i have a question regarding ansible galaxy roles: i want to 
> create a playbook that runs on hosts using balancer role, and this role 
> create service to load balance web server requests between hosts in the 
> webservers hosts, and if i browse the host (http://ansible1.example.com 
> ) it must produce (hello ansible user to 
> ansible1.example.com  on 192.168.137.200) and 
> if i reload it the output should be (hello ansible user to 
> ansible2.example.com  on 192.168.137.201)
> 
> -- 
> 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-proje...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/2fc725b1-bbdb-4829-adc0-bd5c5b6938a9n%40googlegroups.com
>  
> .
> 
> 
> -- 
> Thanks,
> Abhijeet Kasurde
> 
> -- 
> 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-proje...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAFwWkHqUnevzYFw7zsqOe4gyXQB9DL_ukqB4uZ3krPsq1UQGAQ%40mail.gmail.com
>  
> .
> 
> -- 
> 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-proje...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/MN2PR03MB4703206D834D27CA414CDA3EFDAE9%40MN2PR03MB4703.namprd03.prod.outlook.com
>  
> .
> 
> 
> -- 
> Thanks,
> Abhijeet Kasurde
> 
> -- 
> 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/8378a899-e808-4451-a4c1-542b9808ea04n%40googlegroups.com
>  
> .

-- 
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/5E0EAF42-49D6-4E27-B7B9-CE4818997C2F%40gmail.com.


Re: [ansible-project] Access by ssh to an ec2 instance after creating it

2022-04-28 Thread Rilindo Foster
Hi there! That is more of an AWS question than an Ansible question. I might 
suggest posting the question on the AWS forums here:

https://repost.aws/

> On Apr 28, 2022, at 7:10 AM, SysAdmin EM  wrote:
> 
> Hi, I am creating an ec2 instance in AWS, but after creating it I need to log 
> in via SSH and run some tasks on it.
> 
> The instance takes a few minutes to be ready, as I do not know how long it 
> takes to be ready and nor the IP assigned by Amazon, my question as SSH login 
> to a newly created instance without knowing its IP and its creation status?
> Regards,
> 
> -- 
> 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/CAGUDtnnG7CC2Nf1myR23aapyx5zcmsuMQ2keKFLVRZomkg1U6g%40mail.gmail.com
>  
> .

-- 
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/8B6ADC1A-37DD-4DA3-9879-38551C01336E%40gmail.com.


Re: [Ext] [ansible-project] How to set-up playbook level Environment variable after a few tasks

2022-03-28 Thread Rilindo Foster
Alright. My thought would be to register the master key as a fact in one play:

register:  some_confluent_value

And you set the environment variable on the next play that needs it.

- name: some confluent operation
  command: do something
  environment:
CONFLUENT_SECURITY_MASTER_KEY: "{{ some_confluent_value }}"
  register: output
  changed_when: output.rc = 0


—
Rilindo Foster - Cloud Reliability Architect


> On Mar 28, 2022, at 11:32 AM, Arundhati Bhende 
>  wrote:
> 
> Yes.  But the value will be different on each of the target machines and can 
> be determined after the copy  tasks are executed
>  
> From:  on behalf of Rilindo Foster 
> 
> Reply-To: "ansible-project@googlegroups.com" 
> 
> Date: Monday, March 28, 2022 at 10:59 AM
> To: "ansible-project@googlegroups.com" 
> Subject: Re: [Ext] [ansible-project] How to set-up playbook level Environment 
> variable after a few tasks
>  
> So you are saying that you want:
>  
> - CONFLUENT_SECURITY_MASTER_KEY be set?
> - That value be persistent through the remainder of the playbook run?
>  
> —
> Rilindo Foster - Cloud Reliability Architect
> 
> 
> 
>> On Mar 26, 2022, at 9:57 PM, Arundhati Bhende 
>> mailto:arundhati.bhe...@prudential.com>> 
>> wrote:
>>  
>> I need to set a playbook level Environment variable after executing some 
>> tasks.  The variable needs to be set-up separately on each server by reading 
>> a file on the server – I am told I should use slurp, but do not know how to 
>> use it to define playbook level environment variable.
>>  
>> Can someone help?
>>  
>> This is the current version of the playbook
>>  
>>  
>> - name: server properties
>>   hosts: kafka_broker
>>   vars:
>> ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
>> ansible_host_key_checking: false
>> date: "{{ lookup('pipe', 'date +%Y%m%d-%H%M%S') }}"
>> copy_to_dest: "/export/home/kafusr/kafka/secrets"
>> server_props_loc: "/etc/kafka"
>> secrets_props_loc: "{{ server_props_loc }}/secrets"
>>  
>>   environment:
>> CONFLUENT_SECURITY_MASTER_KEY: "”
>>  
>>   tasks:
>>  
>> - name: Create a directory if it does not exist
>>   file:
>> path: "{{ copy_to_dest }}"
>> state: directory
>> mode: '0755'
>>  
>> - name: Find files from "{{ server_props_loc }}"
>>   find:
>> paths: /etc/kafka/
>> patterns: "server.properties*"
>> # ... the rest of the task
>>   register: etc_kafka_server_props
>>  
>> - name: Find files from "{{ secrets_props_loc }}"
>>   find:
>> paths: /etc/kafka/secrets
>> patterns: "*"
>> # ... the rest of the task
>>   register: etc_kafka_secrets_props
>>  
>> - name: Copy the files
>>   copy:
>> src: "{{ item.path }}"
>> dest: "{{ copy_to_dest }}"
>> remote_src: yes
>>   loop: "{{ etc_kafka_server_props.files + etc_kafka_secrets_props.files 
>> }}"
>>  
>>  
>> Need help is setting up CONFLUENT_SECURITY_MASTER_KEY after the copy files 
>> task to read the a file from secrets directory using slurp, and have it 
>> avaibale at playbook level
>>  
>> Regards
>>  
>> -- 
>> 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 
>> <mailto:ansible-project+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CBF647EC-2D0F-4C25-82DD-E5D14A55FB7F%40prudential.com
>>  
>> <https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCBF647EC-2D0F-4C25-82DD-E5D14A55FB7F%2540prudential.com%3Futm_medium%3Demail%26utm_source%3Dfooter=04%7C01%7Carundhati.bhende%40prudential.com%7Ce6d2328aa77145e1331a08da10cb509c%7Cd8fde2f5939242608a030ad01f4746e9%7C0%7C0%7C637840763983257832%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000=g%2FMF7WEHYp6UoDUYcHoWHD%2FIRVDa99YyXlz0bsKsfF4%3D=0>.
> 
>  
> 
> 
>> This email and its attachments are confidential and may be privileged.  Any 
>> unauthorized use or disclosure is prohibi

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

2022-03-28 Thread Rilindo Foster
Can you explain more about multiple domains? What do you intend to do?


—
Rilindo Foster - Cloud Reliability Architect

> On Mar 28, 2022, at 1:22 AM, Pritam Dadhe  wrote:
> 
> Hi Team,
> 
> Can we implement Ansible setup on systems that are on multiple domains.
> If yes what are the steps we need to follow or it can be done with normal 
> setup just by adding IP add to the hosts file.
> 
> Thanks,
> Pritam dadhe 
> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/b10e9f4b-7843-4e33-ae40-ebabf0f0eed3n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ansible-project/b10e9f4b-7843-4e33-ae40-ebabf0f0eed3n%40googlegroups.com?utm_medium=email_source=footer>.


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/B53EF99C-7F13-485C-9C64-231E6D4BA2E4%40nextcapital.com.


Re: [Ext] [ansible-project] How to set-up playbook level Environment variable after a few tasks

2022-03-28 Thread Rilindo Foster
So you are saying that you want:

- CONFLUENT_SECURITY_MASTER_KEY be set?
- That value be persistent through the remainder of the playbook run?

—
Rilindo Foster - Cloud Reliability Architect


> On Mar 26, 2022, at 9:57 PM, Arundhati Bhende 
>  wrote:
> 
> I need to set a playbook level Environment variable after executing some 
> tasks.  The variable needs to be set-up separately on each server by reading 
> a file on the server – I am told I should use slurp, but do not know how to 
> use it to define playbook level environment variable.
>  
> Can someone help?
>  
> This is the current version of the playbook
>  
>  
> - name: server properties
>   hosts: kafka_broker
>   vars:
> ansible_ssh_extra_args: "-o StrictHostKeyChecking=no"
> ansible_host_key_checking: false
> date: "{{ lookup('pipe', 'date +%Y%m%d-%H%M%S') }}"
> copy_to_dest: "/export/home/kafusr/kafka/secrets"
> server_props_loc: "/etc/kafka"
> secrets_props_loc: "{{ server_props_loc }}/secrets"
>  
>   environment:
> CONFLUENT_SECURITY_MASTER_KEY: "”
>  
>   tasks:
>  
> - name: Create a directory if it does not exist
>   file:
> path: "{{ copy_to_dest }}"
> state: directory
> mode: '0755'
>  
> - name: Find files from "{{ server_props_loc }}"
>   find:
> paths: /etc/kafka/
> patterns: "server.properties*"
> # ... the rest of the task
>   register: etc_kafka_server_props
>  
> - name: Find files from "{{ secrets_props_loc }}"
>   find:
> paths: /etc/kafka/secrets
> patterns: "*"
> # ... the rest of the task
>   register: etc_kafka_secrets_props
>  
> - name: Copy the files
>   copy:
> src: "{{ item.path }}"
> dest: "{{ copy_to_dest }}"
> remote_src: yes
>   loop: "{{ etc_kafka_server_props.files + etc_kafka_secrets_props.files 
> }}"
>  
>  
> Need help is setting up CONFLUENT_SECURITY_MASTER_KEY after the copy files 
> task to read the a file from secrets directory using slurp, and have it 
> avaibale at playbook level
>  
> Regards
> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CBF647EC-2D0F-4C25-82DD-E5D14A55FB7F%40prudential.com
>  
> <https://groups.google.com/d/msgid/ansible-project/CBF647EC-2D0F-4C25-82DD-E5D14A55FB7F%40prudential.com?utm_medium=email_source=footer>.


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/47C58C8A-F1C1-47D5-A942-07E2F924C1F5%40nextcapital.com.


Re: [Ext] [ansible-project] i am unable to run ec2 palybook

2022-03-15 Thread Rilindo Foster
Prasanna,

That is not useful, so I am going to make a guess.

Based on this, you are probably using this sensible module:

https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_instance_module.html#ansible-collections-amazon-aws-ec2-instance-module
 
<https://docs.ansible.com/ansible/latest/collections/amazon/aws/ec2_instance_module.html#ansible-collections-amazon-aws-ec2-instance-module>

Based on the error, it is likely you are using image, which requires the value 
be passed as a dictionary. So either the value is passed as a dictionary or you 
simply use image_id - like this from the example:

- name: start an instance with a public IP address
  amazon.aws.ec2_instance:
name: "public-compute-instance"
key_name: "prod-ssh-key"
vpc_subnet_id: subnet-5ca1ab1e
instance_type: c5.large
security_group: default
network:
  assign_public_ip: true
image_id: ami-123456
tags:
  Environment: Testing


—
Rilindo Foster - Cloud Reliability Architect


> On Mar 15, 2022, at 9:38 AM, prasanna kumar  wrote:
> 
> Dear Rilindo foster,
> 
> This is the error code please find attached screenshot.
> 
> 
> 
> 
> On Tue, 15 Mar 2022 at 8:04 PM, Rilindo Foster  <mailto:fost...@nextcapital.com>> wrote:
> Hi Prasanna!
> 
> Can you copy and paste the relevant code that the error is coming from?
> 
> —
> Rilindo Foster - Cloud Reliability Architect
> 
> 
> 
>> On Mar 15, 2022, at 6:14 AM, prasanna kumar > <mailto:prassu.satr...@gmail.com>> wrote:
>> 
>> Dear Dick,
>> 
>> Kindly help me with this issue I am getting errors.
>> 
>> 
>> 
>> 
>> Thanks & regards,
>> Prasanna Kumar .S
>> 
>> -- 
>> 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 
>> <mailto:ansible-project+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAOf-3v7547u%2BDGR-puYpY4A7r48Zgah3LWAsKeKXOwxpyxWABQ%40mail.gmail.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/CAOf-3v7547u%2BDGR-puYpY4A7r48Zgah3LWAsKeKXOwxpyxWABQ%40mail.gmail.com?utm_medium=email_source=footer>.
> 
> 
>> This email and its attachments are confidential and may be privileged.  Any 
>> unauthorized use or disclosure is prohibited.  If you receive this email in 
>> error, please notify the sender and permanently delete the original without 
>> forwarding, making any copies or disclosing its contents. NextCapital is a 
>> brand name representing NextCapital Group, Inc. and its subsidiaries, 
>> NextCapital Software, Inc. and NextCapital Advisers, Inc. 
> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/543BE4D0-4710-4355-A8AF-CE8CF94C4290%40nextcapital.com
>  
> <https://groups.google.com/d/msgid/ansible-project/543BE4D0-4710-4355-A8AF-CE8CF94C4290%40nextcapital.com?utm_medium=email_source=footer>.
> -- 
> Thanks & regards,
> Prasanna Kumar .S
> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAOf-3v7QbLHTDF1eCDxX4BjrdkhyjBUYrwAGo6Nh0RVhD5TB-A%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/ansible-project/CAOf-3v7QbLHTDF1eCDxX4BjrdkhyjBUYrwAGo6Nh0RVhD5TB-A%40mail.gmail.com?utm_medium=email_source=footer>.


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/8C84AB3E-B1B0-413B-B67D-AD868F78912E%40nextcapital.com.


Re: [Ext] [ansible-project] i am unable to run ec2 palybook

2022-03-15 Thread Rilindo Foster
Hi Prasanna!

Can you copy and paste the relevant code that the error is coming from?

—
Rilindo Foster - Cloud Reliability Architect


> On Mar 15, 2022, at 6:14 AM, prasanna kumar  wrote:
> 
> Dear Dick,
> 
> Kindly help me with this issue I am getting errors.
> 
> 
> 
> 
> Thanks & regards,
> Prasanna Kumar .S
> 
> -- 
> 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 
> <mailto:ansible-project+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAOf-3v7547u%2BDGR-puYpY4A7r48Zgah3LWAsKeKXOwxpyxWABQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/ansible-project/CAOf-3v7547u%2BDGR-puYpY4A7r48Zgah3LWAsKeKXOwxpyxWABQ%40mail.gmail.com?utm_medium=email_source=footer>.


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/543BE4D0-4710-4355-A8AF-CE8CF94C4290%40nextcapital.com.


Re: [ansible-project] Running ansible playbook on two hosts

2022-03-08 Thread Rilindo Foster
Hi Netanel,

You can use delegate_to for this.

https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#delegating-tasks

- Rilindo

> On Mar 8, 2022, at 4:16 AM, Netanel Peretz  wrote:
> 
> Hey,
> I want to be able to use a playbook to run a task on host1 then run a task on 
> localhost(ansible host) and then run another task on host1
> 
> 
> Is that supposed to be as simple as copying something like this and changing 
> the hostname and the task that comes after that?
> Is there a better way to do so?
> 
> 
> - name: TASKNAME
>   hosts: host1
>   tasks:
> 
>   - name: TASK ON HOST1
> shell: 
> 
> - name: TASKNAME
>   hosts: localhost
>   tasks:
> 
>   - name: TASK ON LOCALHOST
> shell: 
> 
> - name: TASKNAME
>   hosts: host1
>   tasks:
> 
>   - name: ANTOHER TASK ON HOST1
> shell: 
> -- 
> 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/c2236069-81c8-4cf9-a81f-242927b05455n%40googlegroups.com.

-- 
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/A4DD90E4-03ED-4F6F-9E73-E905BFF464C4%40gmail.com.


Re: [ansible-project] Apt behaviour

2022-03-06 Thread Rilindo Foster
Given John’s statement, add *update_cache: yes”

- name: install additional fonts
  apt:
name: "{{ fonts_packages }}"
state: present
update_cache: yes

> On Mar 6, 2022, at 8:10 PM, Igor Cicimov  
> wrote:
> 
> Hi all,
> 
> Anyone knows why is apt behaving differently here? I have this var
> 
> fonts_packages:
>   - ttf-wqy-zenhei
>   - fonts-takao-mincho
>   - fonts-indic
>   - ttf-wqy-microhei
> 
> and simple task:
> 
> - name: install additional fonts
>   apt:
> name: "{{ fonts_packages }}"
> state: present
> 
>  passing the list to apt.
> 
> That works in Ansible 2.4.4 as expected:
> 
> "invocation": {
> "module_args": {
>  
> "name": [
> "ttf-wqy-zenhei", 
> "fonts-takao-mincho", 
> "fonts-indic", 
> "ttf-wqy-microhei"
> ], 
> "only_upgrade": false, 
> "package": [
> "ttf-wqy-zenhei", 
> "fonts-takao-mincho", 
> "fonts-indic", 
> "ttf-wqy-microhei"
> ], 
> ...
>  
> But in 2.5+ fails because:
> 
> fatal: [hostname]: FAILED! => {
> "changed": false,
> "invocation": {
> "module_args": {
> 
> "name": "['ttf-wqy-zenhei', 'fonts-takao-mincho', 'fonts-indic', 
> 'ttf-wqy-microhei']",
> "only_upgrade": false,
> "package": [
> "['ttf-wqy-zenhei'",
> " 'fonts-takao-mincho'",
> " 'fonts-indic'",
> " 'ttf-wqy-microhei']"
> ],
> ...
> },
> "msg": "No package(s) matching '['ttf-wqy-zenhei'' available"
> }
> 
> I'm passing a list to apt "name" parameter as per the documentation.
> 
> Thanks
> 
> 
>  
> 
> Know Your Customer due diligence on demand, powered by intelligent process 
> automation
> 
> Blogs   |  LinkedIn 
>   |  Twitter 
> 
>  
> 
> Encompass Corporation UK Ltd  |  Company No. SC493055  |  Address: Level 3, 
> 33 Bothwell Street, Glasgow, UK, G2 6NL
> Encompass Corporation Pty Ltd  |  ACN 140 556 896  |  Address: Level 10, 117 
> Clarence Street, Sydney, New South Wales, 2000
> This email and any attachments is intended only for the use of the individual 
> or entity named above and may contain confidential information. 
> If you are not the intended recipient, any dissemination, distribution or 
> copying of this email is prohibited. 
> If received in error, please notify us immediately by return email and 
> destroy the original message.
> 
> 
> 
> 
> -- 
> 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/13465a54-4216-450c-a9f9-a079495425f3n%40googlegroups.com
>  
> .

-- 
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/CC3F3776-ED1C-4136-80F9-AE6B7AD77DDA%40gmail.com.


Re: [ansible-project] Use cases of real time project of ansible

2022-03-01 Thread Rilindo Foster
Hi Prasanna,

Red Hat has a nice walk through on provisioning an EC2 instance and associated 
AWS components, along with deploying an app within the instance.

https://www.redhat.com/sysadmin/ansible-provisioning-aws-cloud 


This would probably help you get started.

- Rilindo

> On Mar 1, 2022, at 6:27 AM, prasanna kumar  wrote:
> 
> Dear Dick,
> 
> Sorry for that, kindly help me with the best practice of example of any use 
> cases of Ansible real-time project web application.
> 
> Thanks & regards,
> Prasanna Kumar .S
> 
> 
> On Tue, Mar 1, 2022 at 5:34 PM Dick Visser  > wrote:
> That is a very vague question.
> The questions on this list are usually the other way around: you
> explain a use case you have, what you have done to automate that using
> Ansible, and then ask a question about a problem .
> Can you reformulate your question in such a way?
> 
> 
> On Tue, 1 Mar 2022 at 12:15, prasanna kumar  > wrote:
> >
> > Dear Team,
> >
> > Kindly provide me with real-time ansible use cases for any  AWS  T3 
> > architecture.
> >
> >
> > Thanks & regards,
> > Prasanna Kumar .S
> >
> > --
> > 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/CAOf-3v4dRa1pbRZcJvHGhMKptzo7Yvu%2BksG4rKysR0Yag0wHkA%40mail.gmail.com
> >  
> > .
> 
> 
> 
> -- 
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
> 
> -- 
> 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/CAL8fbwNRn1n1VRZ6%2Bcx2xzf5CgKEXueq0ceDujfB6_aH-VEdzg%40mail.gmail.com
>  
> .
> 
> -- 
> 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/CAOf-3v7gsxqFj2yUmLUET4Xmq7wyDm2oVszBJdQ%2BnWtQ%2B%2BeNQA%40mail.gmail.com
>  
> .

-- 
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/DC2AA9D2-17F8-4E54-9D49-CB826EBC5895%40gmail.com.


Re: [ansible-project] problem while running role

2022-02-12 Thread Rilindo Foster
1) you may want to upgrade your versions of Ansible - and Python, for that 
matter.

2) if it is only happening on a single host, it makes me wonder if LVM is even 
installed on that host.

- Rilindo

> On Feb 12, 2022, at 10:08 PM, Sk Ashir uddin  wrote:
> 
> Yes!!, it's worked on many env but gets this error while ansible tries to 
> gather facts on the host.
> "line 1605, in get_lvm_facts\r\nIndexError: list index out of range"
> 
> --ashir
>> On Sunday, 13 February 2022 at 00:38:29 UTC+5:30 dick@geant.org wrote:
>> Did this archeological setup work before?
>> 
>> 
>>> On Sat, 12 Feb 2022 at 19:06, Sk Ashir uddin  wrote:
>>> 
>>> The output of "ansible --version"
>>> 
>>>  ansible --version
>>> ansible 2.4.0 (devel a06014663c) last updated 2017/04/18 12:36:51 (GMT +000)
>>>   config file = /opt/ansible/config/ansible.cfg
>>>   configured module search path = [u'/opt/ansible/library']
>>>   ansible python module location = /opt/ansible/lib/ansible
>>>   executable location = /usr/local/bin/ansible
>>>   python version = 2.7.6 (default, Oct 26 2016, 20:30:19) [GCC 4.8.4]
> On Saturday, 12 February 2022 at 23:28:30 UTC+5:30 dick@geant.org 
> wrote:
> On Sat, 12 Feb 2022 at 18:48, Sk Ashir uddin  wrote: 
> > 
> > I just try to run the ansible setup command I get this error, or I 
> > preciously can say this error " line 1605, in get_lvm_facts" and 
> > ansible version is 2.4.7. 
> 
> AFAIK there has never been a version 2.4.7. 
> Also that is not what I asked. 
> 
> > On Friday, 11 February 2022 at 20:01:16 UTC+5:30 dick@geant.org 
> > wrote: 
> >> 
> >> Can there be even less information in your message? 
> >> 
> >> I only see one huge line with an error. 
> >> I'm guessing you want to get rid of it. If so, then you should provide 
> >> much more information: 
> >> 
> >> - what you're trying to do 
> >> - playbook/inventory code 
> >> - output of "ansible --version" 
> 
> This is what I asked. 
> 
> So, please post the output of "ansible --version" 
 
>>> -- 
>> 
>>> 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-proje...@googlegroups.com.
>> 
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/dbf31cc9-567f-4797-ab5d-b39face62d40n%40googlegroups.com.
>> -- 
>> Sent from a mobile device - please excuse the brevity, spelling and 
>> punctuation.
> 
> -- 
> 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/82cc93b0-3497-46af-bc86-6b4f450d6254n%40googlegroups.com.

-- 
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/556B5E15-5310-4FDF-BD05-F16787D06B5D%40gmail.com.


Re: [ansible-project] Action failed_when not working with condition

2022-02-09 Thread Rilindo Foster
Not an answer, but a thought - instead of using the shell module, have you 
thought about using the mysql_info module?

https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_info_module.html#ansible-collections-community-mysql-mysql-info-module
 


Or any other of the mySQL modules:

https://docs.ansible.com/ansible/latest/collections/community/mysql/index.html 


> On Feb 9, 2022, at 10:51 AM, SysAdmin EM  > wrote:
> 
> Hello, I am creating a playbook, in the first task I am checking if a 
> database exists which is previously created with another task.
> I need to finish the playbook if the database does not exist, for this to 
> assemble the next playbook
> 
> - name: Check if database exists
>   shell: |
> mysql -hhost -uuser -ppassword -e "show databases" | egrep db
>   register: mysql_exist
>   failed_when: "'FAILED' in mysql_exist.stderr"
> 
> - name:
>   debug:
> msg: "{{ mysql_exist.stdout }}"
> 
> but the playbook keeps going and I need it to end the playbook if the 
> database doesn’t exist.
> 
> the next task called "Check Queue in RabbitMQ" should not be executed because 
> the database does not exist.
> 
> changed: [server01-stage]
> TASK [debug] 
> ***
> ok: [server01-stage] => {
> "msg": ""
> }
> TASK [Check Queue in RabbitMQ] 
> 
> fatal: [schedule01-stage]: FAILED! => {"changed": true, "cmd": "rabbitmqadmin 
> --host=host --port=port2 --username=user --password=usert -f long list queues 
> | egrep \"AWPP\"\n", "delta": "0:00:00.389108", "end": "2022-02-09 
> 16:42:13.394477", "msg": "non-zero return code", "rc": 1, "start": 
> "2022-02-09 16:42:13.005369", "stderr": "", "stderr_lines": [], "stdout": "", 
> "stdout_lines": []}
> PLAY RECAP 
> *
> schedule01-stage : ok=2 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 
> ignored=0
> 
> any helps??
> 
> Regards,
> 
> -- 
> 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/CAGUDtnm3JqG4VQAPMi0RzhFOp-NUCBr5LQWLcof85VEbv03Hfg%40mail.gmail.com
>  
> .

-- 
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/67FFB01C-9707-40BF-B4E7-128A156E76A1%40gmail.com.


Re: [ansible-project] Action failed_when not working with condition

2022-02-09 Thread Rilindo Foster
Not an answer, but a thought - instead of using the shell module, have you 
thought about using the mysql_info module?

https://docs.ansible.com/ansible/latest/collections/community/mysql/mysql_info_module.html#ansible-collections-community-mysql-mysql-info-module
 


Or any other of the mySQL modules:

https://docs.ansible.com/ansible/latest/collections/community/mysql/index.html

> On Feb 9, 2022, at 10:51 AM, SysAdmin EM  wrote:
> 
> Hello, I am creating a playbook, in the first task I am checking if a 
> database exists which is previously created with another task.
> I need to finish the playbook if the database does not exist, for this to 
> assemble the next playbook
> 
> - name: Check if database exists
>   shell: |
> mysql -hhost -uuser -ppassword -e "show databases" | egrep db
>   register: mysql_exist
>   failed_when: "'FAILED' in mysql_exist.stderr"
> 
> - name:
>   debug:
> msg: "{{ mysql_exist.stdout }}"
> 
> but the playbook keeps going and I need it to end the playbook if the 
> database doesn’t exist.
> 
> the next task called "Check Queue in RabbitMQ" should not be executed because 
> the database does not exist.
> 
> changed: [server01-stage]
> TASK [debug] 
> ***
> ok: [server01-stage] => {
> "msg": ""
> }
> TASK [Check Queue in RabbitMQ] 
> 
> fatal: [schedule01-stage]: FAILED! => {"changed": true, "cmd": "rabbitmqadmin 
> --host=host --port=port2 --username=user --password=usert -f long list queues 
> | egrep \"AWPP\"\n", "delta": "0:00:00.389108", "end": "2022-02-09 
> 16:42:13.394477", "msg": "non-zero return code", "rc": 1, "start": 
> "2022-02-09 16:42:13.005369", "stderr": "", "stderr_lines": [], "stdout": "", 
> "stdout_lines": []}
> PLAY RECAP 
> *
> schedule01-stage : ok=2 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 
> ignored=0
> 
> any helps??
> 
> Regards,
> 
> -- 
> 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/CAGUDtnm3JqG4VQAPMi0RzhFOp-NUCBr5LQWLcof85VEbv03Hfg%40mail.gmail.com
>  
> .

-- 
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/9EEEA8DD-F8FF-4E96-9E77-590BE7E2E7F5%40gmail.com.


Re: [ansible-project] Get memory info using Ansible

2022-02-08 Thread Rilindo Foster
Hi Dip!

Assuming that you are referring to this code, note that that Ansible will run 
python on the target node - Python the interpreter itself will consume memory. 
And then if you run the shell module under Ansible, it will spawn a shell which 
itself will consume memory as well.

- Rilindo

> On Feb 8, 2022, at 8:46 AM, Dip Giri  wrote:
> 
> Whatever ansible give a memory info in ansible_fact it doesn't match with 
> memory info 
> that we get from free -m command. Why this problem happened for that if have 
> any solution plz give me 
> 
> ---
> - name: Setup server
> hosts: localhost
> tasks:
> 
> - name: test
> shell: free -m
> register: xyz
> 
> - name: Print service status
> debug:
> msg: "{{ansible_memory_mb.real}}"
> 
> - name: Print service status
> debug:
> msg: "{{xyz.stdout.split('\n')}}"
> 
> -- 
> 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/74109954-cb3c-4b72-a5b0-34f9e425f16fn%40googlegroups.com
>  
> .

-- 
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/BD74359A-3C8D-4DFE-8A50-6FDF2A48A4F7%40gmail.com.


Re: [ansible-project] Adding if statement inside a task

2022-02-07 Thread Rilindo Foster
Hi there!

What was the problem that you are trying to solve? I don’t see an actual 
question that we can answer.

> On Feb 7, 2022, at 8:29 AM, dudu.c...@gmail.com  
> wrote:
> 
> Hi
> I have the following playbook.  
> In the environment.yml file I have a parameter "tls=true"
> 
> In the below task , In tghe URL I would put https if tls=true and http if 
> false.
>  
> - hosts: manager
>   vars_files:
> - ./environment.yml
>   tasks:
> 
>  - name: test - check connectivity to  API
> get_url:
> url: http://{{ server.hostname }}.{{ domain }}:/api//{{ 
> cluster_name }}
> dest: /tmp/
> mode: 0777
> force: yes
> url_username: "{{ username }}"
> url_password: "{{ password }}"
> validate_certs: no
> register: msg
> ignore_errors: true
> 
> Thanks 
> 
> -- 
> 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/d87db8f5-2d22-4d65-8d16-efa6a3041012n%40googlegroups.com
>  
> .

-- 
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/8D864036-7A90-4282-9EBC-E45F085A0AB8%40gmail.com.


Re: [ansible-project] Could not find the requested service ntpd: host

2022-02-04 Thread Rilindo Foster
Arjun,

We don’t know without the error. Please paste in the error that you saw earlier.

- Rilindo

> On Feb 4, 2022, at 9:10 AM, arjungoel 1995  wrote:
> 
> Hi, I tried with the ntp under service module a couple of hours ago but that 
> didn't work. But now I tried to run the same code and it worked for me. 
> Similarly I ran a sample ansible playbook for Apache Service and first it 
> gave me that error and then it ran successfully. Was it a temporary issue?
> 
> Thanks
> Arjun Goel
> 
> On Fri, Feb 4, 2022 at 5:24 PM Parth Patel  > wrote:
> Make sure to provide output not just error.
> 
> Give a try changing name: ntp under service module.
> 
> 
> 
> On Fri, 4 Feb 2022 at 4:59 PM, arjungoel 1995  > wrote:
> I am getting the above error while running this ansible playbook:
> 
> `
> ---
> - hosts: all
>   become: yes
>   tasks:
> - name: Ensure NTP is installed.
>   yum: name=ntp state=present
> - name: Ensure NTP is running.
>   service: 
> name: ntpd
> state: started
> enabled: yes
> 
> `
> 
> Can someone please rectify the issue which is causing this error?
> 
> Thanks
> 
> -- 
> 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/9df24adc-c6ac-484b-9060-4d5b9327871an%40googlegroups.com
>  
> .
> 
> -- 
> 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/CAEMGyLK9Nwkn61ZovVpLWF2_wYcKTYX5CPPmzX7XBJ0d0nE7ow%40mail.gmail.com
>  
> .
> 
> -- 
> 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/CALh2VP%2BtOrnHc-5vpdCgsX4UhCRVk3RNC-MAi-Aby1JWwZObmQ%40mail.gmail.com
>  
> .

-- 
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/436F9B90-13DF-4293-B92B-3D8323E3E713%40gmail.com.


Re: [ansible-project] XML to Datetime

2022-02-04 Thread Rilindo Foster
Perhaps the XML module is an option:

https://docs.ansible.com/ansible/latest/collections/community/general/xml_module.html

> On Feb 3, 2022, at 3:13 PM, Amarpreet Singh  wrote:
> 
> Looking for help to convert XML output of a ssl certificate and get date out 
> of it. 
> Then compare and check if that cert has expired or not.
> 
> output
> 
> "stdout": "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}",
> "stdout_lines": [
> "{\"not-valid-after\": \"Apr 20 17:36:03 2022 GMT\"}"
> ],
> "stdout_xml": "Apr 20 17:36:03 2022 
> GMT\n"
> 
> I am looking to change the red highlighted line in datetime format. 
> 
> 
> -- 
> 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/26e20e6e-5c9b-45f6-96e4-f523f5fa8534n%40googlegroups.com
>  
> .

-- 
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/1A1A690B-A27C-4453-BE38-3C3DCE7835EF%40gmail.com.


Re: [Ext] [ansible-project] Unable to create EC2 Instance

2022-01-13 Thread Rilindo Foster
You would want to use image_id instead of image:

tasks:
  - ec2_instance:
  image_id: ami-abc123


> On Jan 12, 2022, at 11:47 PM, Karuppasamy Nallusamy  wrote:
> 
> Hi,
> 
> I just started learning Ansible.
> 
> I am trying to create EC2 instance from my managed host, configured on Mac OS 
> Sierra but getting below error. 
> 
> Playbook:
> 
> 
> 
> Output Error:
> 
> 
> 
> Kindly help.
> 
> -- 
> 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/1f8642c1-269b-4971-9cd9-a027c3efed35n%40googlegroups.com
>  
> .
> 


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/895AA54C-257C-475F-A0C1-0268F9D70E65%40nextcapital.com.


Re: [Ext] [ansible-project] Keeping directory content in sync

2021-11-22 Thread Rilindo Foster
Hi John,

Is synchronize an option?

https://docs.ansible.com/ansible/2.9/modules/synchronize_module.html#synchronize-module

- Rilindo

> On Nov 22, 2021, at 1:59 PM, John Petro  wrote:
> 
> I am working on a role for work, and it needs to keep the source directory ( 
> that lives on the ansible controlnode ), and the destination ( lives on teh 
> remote ) in sync. I know that the copy module can keep the changes/additions 
> in sync.  I am not so much worried about that part.  Where I am getting 
> stuck, is how to handle if we delete a file at the source, and want that 
> delete carried forward to the remote.
> 
> Is there a good way to do that, other than stat the files, loop through the 
> variable, and delete anything that doesn't exist?
> 
> Any advice you have here would be much appreciated.
> 
> --John
> 
> -- 
> 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/CAPAjob8UvQuOSCGMUqiO--vM6dVAB27aa_-RMmYegbCtcCninw%40mail.gmail.com
>  
> .


-- 
This email and its attachments are confidential and may be privileged.  Any 
unauthorized use or disclosure is prohibited.  If you receive this email in 
error, please notify the sender and permanently delete the original without 
forwarding, making any copies or disclosing its contents. NextCapital is a 
brand name representing NextCapital Group, Inc. and its subsidiaries, 
NextCapital Software, Inc. and NextCapital Advisers, Inc. 

-- 
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/1DF1D585-4290-4523-85F6-0CE71B1DD826%40nextcapital.com.


[ansible-project] Credstash Plugin Lookup Failure with Variable

2017-02-17 Thread Rilindo Foster
I am trying to lookup a secret through Ansible's credstash plugin by first 
setting the variable of the table (since I have multiple credstash tables) 
and then looking it up - , something like this:

credstash_table: "foo_credstash_{{ bar }}""
password: "{{ lookup('credstash', 'password', table={{ credstash_table 
}} ) }}"

Somehow, it doesn't seem to like this:

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": 
"AnsibleError: 
{{ lookup('credstash', 'password', table={{ credstashtable }} ) }}: 
template error while templating string: expected token ':', got '}'. 
String: {{ lookup('credstash', 'password', table={{ credstashtable }} ) }}"}


I tried this approach:


credstash_table: "foo_credstash_{{ bar }}""
password: "{{ lookup('credstash', 'password', table='{{ credstash_table 
}}' ) }}"


Only to get this:

 amazon-ebs: fatal: [localhost]: FAILED! => {"changed": false, "failed": true, 
"msg": "AnsibleError: {{ lookup('credstash', 'password', table='{{ 
credstashtable }}' ) }}: An unhandled exception occurred while running the 
lookup plugin 'credstash'. Error was a , 
original message: Encountered exception while fetching password: An error 
occurred (ValidationException) when calling the Query operation: 1 validation 
error detected: Value '{{ credstashtable }}' at 'tableName' failed to satisfy 
constraint: Member must satisfy regular expression pattern: [a-zA-Z0-9_.-]+"}

At the moment, I am using a combination of a bash wrappr script and pipes 
to pull that info. It works, but I am not liking that approach.

What would be the right way to look up the table set as a variable in the 
plugin? Or am I doing it wrong?

- Rilindo

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/58b6a2cb-a10b-4cfc-979d-f22f00b638d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible 2.0 -- the "new" correct way to update??

2016-01-20 Thread Rilindo Foster
I switched over to Homebrew to install current release of Ansible (after 
removing the prior release with pip).
--
Rilindo Foster


On Jan 18, 2016, at 2:07 PM, Chris Short 
<ch...@chrisshort.net<mailto:ch...@chrisshort.net>> wrote:

It seems to me that the issue revolves around upgrading setuptools. I'm totally 
okay with uninstalling and reinstalling Ansible but I am curious about "better" 
ways of upgrading if people would like to share them.

On Friday, January 15, 2016 at 11:29:58 AM UTC-5, Slim Slam wrote:
As you may recall, I had to uninstall Ansible 1.9.4 in order to install Ansible 
2.0.0.0. But now, upgrading to Ansible 2.0.0.2 succeeds but has no effect.
I'm on MacOSX El Capitan (10.11.2)

$ ansible --version
ansible 2.0.0.0
  config file =
  configured module search path = Default w/o overrides
$

$ sudo -H pip install --upgrade ansible --user python
Password:
Collecting ansible
  Downloading ansible-2.0.0.2.tar.gz (1.5MB)
100% || 1.5MB 258kB/s
Requirement already up-to-date: python in 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
Requirement already up-to-date: paramiko in /Library/Python/2.7/site-packages 
(from ansible)
Requirement already up-to-date: jinja2 in /Library/Python/2.7/site-packages 
(from ansible)
Requirement already up-to-date: PyYAML in /Library/Python/2.7/site-packages 
(from ansible)
Collecting setuptools (from ansible)
  Using cached setuptools-19.2-py2.py3-none-any.whl
Requirement already up-to-date: pycrypto>=2.6 in 
/Library/Python/2.7/site-packages (from ansible)
Requirement already up-to-date: ecdsa>=0.11 in 
/Library/Python/2.7/site-packages (from paramiko->ansible)
Requirement already up-to-date: MarkupSafe in /Library/Python/2.7/site-packages 
(from jinja2->ansible)
Installing collected packages: setuptools, ansible
  Running setup.py install for ansible
Successfully installed ansible-2.0.0.2 setuptools-1.1.6
$


$ ansible --version
ansible 2.0.0.0
  config file =
  configured module search path = Default w/o overrides
$

What is the correct way to handle updates going forward?

--
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<mailto:ansible-project+unsubscr...@googlegroups.com>.
To post to this group, send email to 
ansible-project@googlegroups.com<mailto:ansible-project@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3e8b46dc-f085-4a7b-a855-440403543cd8%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/3e8b46dc-f085-4a7b-a855-440403543cd8%40googlegroups.com?utm_medium=email_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/02386FE7-3751-410D-B0DB-55A22ABD8830%40connectedhealth.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Multiple group_vars for group of hosts

2014-01-10 Thread Rilindo Foster
Is it possible to have multiple group_vars for a group of hosts? Here is my use 
case: I got a  group of servers, some admins and some engineers. All engineers 
should have access to all servers, (such as lab servers), but admins will not 
have access to all servers. 


it seems the way to do it is the following:

group_vars/all

group_vars/eng

Where all the users are in all, but only engineers are in eng, which will 
override all. 

But that means duplication, because the engineers will be in in all and 
eng, which I am not very comfortable with. LIkely, I would something like 
this:

group_vars/admin
group_vars/eng

And then somehow use them with the inventory, which I am a bit fuzzy on. Is it 
possible or is there a better way?

 - Rilindo

-- 
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 post to this group, send email to ansible-project@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.