[ansible-project] Re: Ansible dynamic looping

2018-02-02 Thread Triển Lập Lâm
Hi,

can you try "with_fileglob" ? Refer in 
http://docs.ansible.com/ansible/latest/playbooks_loops.html#id4


Vào 07:01:51 UTC+7 Thứ Sáu, ngày 02 tháng 2 năm 2018, Andrew Morgan đã viết:
>
> Hello all,
>
> I have a play I want to run wich deletes all hosts matching a certain 
> criteria:
>
> tasks:
>   - name: Delete unavailable nodes
> zabbix_host:
>  server_url: http://zabbix.aa.net/zabbix
>  login_user: Admin
>  login_password: aq!
>  host_groups: Discovered hosts
>  status: disabled
>  state: absent
>  host_name: "{{ item }}"
> with_items:
>  - ip-10-1-*-*.us-west-2.compute.internal
> 
>
>
> The above doesnt work, but if I list out the items
> with_items:
>  - ip-10-1-65-27.us-west-2.compute.internal
>  - ip-10-1-65-28.us-west-2.compute.internal
>  - ip-10-1-65-37.us-west-2.compute.internal
>
> then it works, but I want it to be dynamic and find all ips matching  
> - ip-10-1-*-*.us-west-2.compute.internal
>
> any help please?
>

-- 
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/6d65b753-fb74-4302-81db-dd64acb3c062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Tower Installation failed in RHEL 7.4 with error pkg_resources.DistributionNotFound: awx==3.2.2

2018-02-01 Thread Triển Lập Lâm
Hi all

The installation fails in the step "Migrate the Tower database schema" 
after run file  setup.sh in ansible-tower-setup-3.2.2

May I miss any setting ?
Please help me to take a look.

Thanks


TASK [awx_install : Stop supervisor] 
***
ok: [localhost] => {"changed": false, "name": "supervisord", "state": 
"stopped", "status": {"ActiveEnterTimestampMonotonic": "0", 
"ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": 
"systemd-journald.socket system.slice basic.target rc-local.service 
nss-user-lookup.target", "AllowIsolate": "no", "AmbientCapabilities": "0", 
"AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": 
"shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": 
"18446744073709551615", "CPUAccounting": "no", "CPUQuotaPerSecUSec": 
"infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", 
"CPUSchedulingResetOnFork": "no", "CPUShares": "18446744073709551615", 
"CanIsolate": "no", "CanReload": "no", "CanStart": "yes", "CanStop": "yes", 
"CapabilityBoundingSet": "18446744073709551615", "ConditionResult": "no", 
"ConditionTimestampMonotonic": "0", "Conflicts": "shutdown.target", 
"ControlPID": "0", "DefaultDependencies": "yes", "Delegate": "no", 
"Description": "Process Monitoring and Control Daemon", "DevicePolicy": 
"auto", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", 
"ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", 
"ExecMainStatus": "0", "ExecStart": "{ path=/usr/bin/supervisord ; 
argv[]=/usr/bin/supervisord -c /etc/supervisord.conf ; ignore_errors=no ; 
start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", 
"FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": 
"/usr/lib/systemd/system/supervisord.service", "GuessMainPID": "yes", 
"IOScheduling": "0", "Id": "supervisord.service", "IgnoreOnIsolate": "no", 
"IgnoreOnSnapshot": "no", "IgnoreSIGPIPE": "yes", 
"InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": 
"0", "JobTimeoutAction": "none", "JobTimeoutUSec": "0", "KillMode": 
"control-group", "KillSignal": "15", "LimitAS": "18446744073709551615", 
"LimitCORE": "18446744073709551615", "LimitCPU": "18446744073709551615", 
"LimitDATA": "18446744073709551615", "LimitFSIZE": "18446744073709551615", 
"LimitLOCKS": "18446744073709551615", "LimitMEMLOCK": "65536", 
"LimitMSGQUEUE": "819200", "LimitNICE": "0", "LimitNOFILE": "4096", 
"LimitNPROC": "2063094", "LimitRSS": "18446744073709551615", "LimitRTPRIO": 
"0", "LimitRTTIME": "18446744073709551615", "LimitSIGPENDING": "2063094", 
"LimitSTACK": "18446744073709551615", "LoadState": "loaded", "MainPID": 
"0", "MemoryAccounting": "no", "MemoryCurrent": "18446744073709551615", 
"MemoryLimit": "18446744073709551615", "MountFlags": "0", "Names": 
"supervisord.service", "NeedDaemonReload": "no", "Nice": "0", 
"NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", 
"OOMScoreAdjust": "0", "OnFailureJobMode": "replace", 
"PermissionsStartOnly": "no", "PrivateDevices": "no", "PrivateNetwork": 
"no", "PrivateTmp": "no", "ProtectHome": "no", "ProtectSystem": "no", 
"RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": 
"no", "Requires": "basic.target", "Restart": "no", "RestartUSec": "100ms", 
"Result": "success", "RootDirectoryStartOnly": "no", 
"RuntimeDirectoryMode": "0755", "SameProcessGroup": "no", "SecureBits": 
"0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", 
"StandardError": "inherit", "StandardInput": "null", "StandardOutput": 
"journal", "StartLimitAction": "none", "StartLimitBurst": "5", 
"StartLimitInterval": "1000", "StartupBlockIOWeight": 
"18446744073709551615", "StartupCPUShares": "18446744073709551615", 
"StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", 
"SyslogLevelPrefix": "yes", "SyslogPriority": "30", 
"SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", 
"TTYVTDisallocate": "no", "TasksAccounting": "no", "TasksCurrent": 
"18446744073709551615", "TasksMax": "18446744073709551615", 
"TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", 
"TimerSlackNSec": "5", "Transient": "no", "Type": "forking", "UMask": 
"0022", "UnitFilePreset": "disabled", "UnitFileState": "disabled", "Wants": 
"system.slice", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0"}}

TASK [awx_install : Wait for supervisor to stop.] 
**
ok: [localhost] => {"attempts": 1, "changed": false, "stat": {"exists": 
false}}

TASK [awx_install : Migrate the Tower database schema (may take awhile when 
upgrading).] 
***
fatal: [localhost]: FAILED! => {"changed": true,