'Controlling account that runs ansible script vs. ssh account that connects to target server
Scenario: two linux servers; First is ansible controller node - srvControler. Second server is remote target - srvTarget. On ansible controller node (srvControler) i have two accounts accXXX and accYYY. User accXXX exist on srvControler and DOES NOT exist on srvTarget (user accXXX cannot ssh passwordleslly to srvTarget). User accYYY exist on srvControler and on srvTarget (user accYYY can ssh passwordleslly to srvTarget). When i run ansible script from srvControler using accYYY everything works fine. Is there a way to run ansible script on srvControler as user accXXX (one more time - it cannot ssh to srvTarget) but somewhow use ssh passwordless connection that accYYY provides. In other words is it possible (and how) to use accXXX to run script but ssh connect to srvTarget using accYYY?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|