LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-20-2022, 02:02 AM   #1
1s440
Member
 
Registered: Mar 2018
Posts: 266

Rep: Reputation: Disabled
use different users for the task


Hi all,

I am looking for some suggestions,how best i can do with ansible. I have a task running with environment as become_user and i would need to repeat the tasks for all different users. that means the same task i need to run on different hosts and as different user.
Code:
---
- hosts: host.1
  remote_user: user144
  become: yes
  become_user: user1

  tasks:
    ---- 
    ----
    - debug:
	-----

- hosts: host.2
  remote_user: user144
  become: yes
  become_user: user2

  tasks:
    ---- 
    ----
    - debug:
	-----

Last edited by 1s440; 06-21-2022 at 02:18 AM.
 
Old 06-27-2022, 06:54 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
What was your solution then?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kernel panic attempted to kill the idle task! in idle task - not syncing dudutworld Linux - Newbie 2 09-16-2013 01:50 PM
How to kill a task when the task won't die? Ook Slackware 10 03-27-2012 08:13 AM
Python - Problems when trying to run a task at log on task on windows doomloard Programming 2 06-18-2011 04:31 PM
launching a task from cli and "divorcing it from terminal task wufo Linux - General 6 02-11-2011 11:32 AM
Task bar no longer shows task Richard Rahl Linux - Newbie 3 04-12-2010 09:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration