Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command not found\niptables v1.4.21: Invalid rule number #297

Open
qasims opened this issue Feb 22, 2016 · 1 comment
Open

Command not found\niptables v1.4.21: Invalid rule number #297

qasims opened this issue Feb 22, 2016 · 1 comment
Assignees

Comments

@qasims
Copy link
Contributor

qasims commented Feb 22, 2016

Hi, I am doing fresh installation of IdP when I run idp-ldap.yml I get following error.


root@idp:/etc/ansible/group_vars# ansible-playbook -k -u root --ask-vault-pass /etc/ansible/idp-ldap.yml -vvvv
Using /etc/ansible/ansible.cfg as config file
SSH password:
SUDO password[defaults to SSH password]:
Vault password:
 [WARNING]: While constructing a mapping from /etc/ansible/group_vars/identity-ssa.yml, line 3, column 1, found a duplicate dict key (host_institute).  Using last defined value only.

Loaded callback default of type stdout, v2.0
2 plays in /etc/ansible/idp-ldap.yml

PLAY [Configure the LDAP machine] **********************************************

TASK [setup] *******************************************************************
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177411.64-188803566936801 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177411.64-188803566936801 )" )'
<idp.sa0bxi.se> PUT /tmp/tmpqy_EYv TO /home/qasim/.ansible/tmp/ansible-tmp-1456177411.64-188803566936801/setup
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[idp.sa0bxi.se]'
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se 'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/qasim/.ansible/tmp/ansible-tmp-1456177411.64-188803566936801/setup; rm -rf "/home/qasim/.ansible/tmp/ansible-tmp-1456177411.64-188803566936801/" > /dev/null 2>&1'
ok: [idp.sa0bxi.se]

TASK [fmarco76.firewall : Retrieve iptables rules] *****************************
task path: /etc/ansible/roles/fmarco76.firewall/tasks/main.yml:3
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177415.7-80404139248815 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177415.7-80404139248815 )" )'
<idp.sa0bxi.se> PUT /tmp/tmpXd9AmV TO /home/qasim/.ansible/tmp/ansible-tmp-1456177415.7-80404139248815/command
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[idp.sa0bxi.se]'
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=ccnihkrxplwuubeewlypdtghwzfnjdrm] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-ccnihkrxplwuubeewlypdtghwzfnjdrm; LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/qasim/.ansible/tmp/ansible-tmp-1456177415.7-80404139248815/command; rm -rf "/home/qasim/.ansible/tmp/ansible-tmp-1456177415.7-80404139248815/" > /dev/null 2>&1'"'"'"'"'"'"'"'"''"'"''
ok: [idp.sa0bxi.se] => {"changed": false, "cmd": ["iptables", "-t", "filter", "-L", "-n"], "delta": "0:00:00.017126", "end": "2016-02-22 22:43:36.210982", "invocation": {"module_args": {"_raw_params": "iptables -t filter -L -n", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 0, "start": "2016-02-22 22:43:36.193856", "stderr": "", "stdout": "Chain INPUT (policy ACCEPT)\ntarget     prot opt source               destination         \n\nChain FORWARD (policy ACCEPT)\ntarget     prot opt source               destination         \n\nChain OUTPUT (policy ACCEPT)\ntarget     prot opt source               destination         ", "stdout_lines": ["Chain INPUT (policy ACCEPT)", "target     prot opt source               destination         ", "", "Chain FORWARD (policy ACCEPT)", "target     prot opt source               destination         ", "", "Chain OUTPUT (policy ACCEPT)", "target     prot opt source               destination         "], "warnings": []}

TASK [fmarco76.firewall : Count iptables rules] ********************************
task path: /etc/ansible/roles/fmarco76.firewall/tasks/main.yml:11
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=wmeabchfqnjtebqocfwbrmgjeqxzxppl] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-wmeabchfqnjtebqocfwbrmgjeqxzxppl; iptables -t filter -S INPUT | grep -v "\-P" | wc -l | tr -d "\n"'"'"'"'"'"'"'"'"''"'"''
ok: [idp.sa0bxi.se] => {"changed": false, "invocation": {"module_args": {"_raw_params": "iptables -t filter -S INPUT | grep -v \"\\-P\" | wc -l | tr -d \"\\n\""}, "module_name": "raw"}, "rc": 0, "stderr": "OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 3981\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\nShared connection to idp.sa0bxi.se closed.\r\n", "stdout": "\r\n\r\n0", "stdout_lines": ["", "", "0"]}

TASK [fmarco76.firewall : Apply rules for the local network] *******************
task path: /etc/ansible/roles/fmarco76.firewall/tasks/main.yml:19
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177416.84-273598259067029 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177416.84-273598259067029 )" )'
<idp.sa0bxi.se> PUT /tmp/tmptgtyGJ TO /home/qasim/.ansible/tmp/ansible-tmp-1456177416.84-273598259067029/command
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[idp.sa0bxi.se]'
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=jztksriynhordhzovrbotsfkfdkgaxji] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-jztksriynhordhzovrbotsfkfdkgaxji; LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/qasim/.ansible/tmp/ansible-tmp-1456177416.84-273598259067029/command; rm -rf "/home/qasim/.ansible/tmp/ansible-tmp-1456177416.84-273598259067029/" > /dev/null 2>&1'"'"'"'"'"'"'"'"''"'"''
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177417.52-120974474170344 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1456177417.52-120974474170344 )" )'
<idp.sa0bxi.se> PUT /tmp/tmpy55Y8k TO /home/qasim/.ansible/tmp/ansible-tmp-1456177417.52-120974474170344/command
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r '[idp.sa0bxi.se]'
<idp.sa0bxi.se> ESTABLISH SSH CONNECTION FOR USER: qasim
<idp.sa0bxi.se> SSH: EXEC sshpass -d14 ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o User=qasim -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r -tt idp.sa0bxi.se '/bin/sh -c '"'"'sudo -H -S  -p "[sudo via ansible, key=tooiypgrshvmdbpmilretavntnrhlxqz] password: " -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-tooiypgrshvmdbpmilretavntnrhlxqz; LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python /home/qasim/.ansible/tmp/ansible-tmp-1456177417.52-120974474170344/command; rm -rf "/home/qasim/.ansible/tmp/ansible-tmp-1456177417.52-120974474170344/" > /dev/null 2>&1'"'"'"'"'"'"'"'"''"'"''
failed: [idp.sa0bxi.se] => (item=389) => {"changed": true, "cmd": ["bash", "-c", "x=\r\n\r\n0 ; iptables -t filter -I INPUT ${x/0/1} -p tcp -m state --state NEW -s 44.140.63.5/255.255.255.192  --dport 389 -j ACCEPT"], "delta": "0:00:00.031026", "end": "2016-02-22 22:43:37.393967", "failed": true, "invocation": {"module_args": {"_raw_params": "bash -c \"x=\r\n\r\n0 ; iptables -t filter -I INPUT ${x/0/1} -p tcp -m state --state NEW -s 44.140.63.5/255.255.255.192  --dport 389 -j ACCEPT\"", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "item": 389, "rc": 2, "start": "2016-02-22 22:43:37.362941", "stderr": "bash: line 1: $'\\r': command not found\nbash: line 2: 0: command not found\niptables v1.4.21: Invalid rule number `\r'\nTry `iptables -h' or 'iptables --help' for more information.", "stdout": "", "stdout_lines": [], "warnings": []}
failed: [idp.sa0bxi.se] => (item=636) => {"changed": true, "cmd": ["bash", "-c", "x=\r\n\r\n0 ; iptables -t filter -I INPUT ${x/0/1} -p tcp -m state --state NEW -s 44.140.63.5/255.255.255.192  --dport 636 -j ACCEPT"], "delta": "0:00:00.031193", "end": "2016-02-22 22:43:37.994119", "failed": true, "invocation": {"module_args": {"_raw_params": "bash -c \"x=\r\n\r\n0 ; iptables -t filter -I INPUT ${x/0/1} -p tcp -m state --state NEW -s 44.140.63.5/255.255.255.192  --dport 636 -j ACCEPT\"", "_uses_shell": false, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "item": 636, "rc": 2, "start": "2016-02-22 22:43:37.962926", "stderr": "bash: line 1: $'\\r': command not found\nbash: line 2: 0: command not found\niptables v1.4.21: Invalid rule number `\r'\nTry `iptables -h' or 'iptables --help' for more information.", "stdout": "", "stdout_lines": [], "warnings": []}

PLAY RECAP *********************************************************************
idp.sa0bxi.se              : ok=3    changed=0    unreachable=0    failed=1

@qasims
Copy link
Contributor Author

qasims commented Feb 29, 2016

Any update?

@brucellino brucellino self-assigned this Oct 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants