diff --git a/CHANGELOG.md b/CHANGELOG.md index 750898307a..377608f9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ New modules: Misc changes: -* Added `state=touch` to the file module, which functions similarly to the command-line version of `touch` +* Added `ansible_env` to the list of facts returned by the setup module. +* Added `state=touch` to the file module, which functions similarly to the command-line version of `touch`. * Added a -vvvv level, which will show SSH client debugging information in the event of a failure. * Includes now support the more standard syntax, similar to that of role includes and dependencies. It is no longer necessary to specify a special "vas" field for the variables passed to the include. * Changed the `user:` parameter on plays to `remote_user:` to prevent confusion with the module of the same name. Still backwards compatible on play parameters. diff --git a/library/system/setup b/library/system/setup index 6b5a53e4f6..13c1bd8ea4 100755 --- a/library/system/setup +++ b/library/system/setup @@ -147,6 +147,7 @@ class Facts(object): self.get_date_time_facts() self.get_user_facts() self.get_local_facts() + self.get_env_facts() def populate(self): return self.facts @@ -457,6 +458,10 @@ class Facts(object): def get_user_facts(self): self.facts['user_id'] = getpass.getuser() + def get_env_facts(self): + self.facts['env'] = {} + for k,v in os.environ.iteritems(): + self.facts['env'][k] = v class Hardware(Facts): """