2016-03-14 17:57:40 +08:00
|
|
|
---
|
|
|
|
- name: download python
|
2016-12-15 22:28:59 +08:00
|
|
|
raw: cd $HOME && https_proxy="{{ lookup('env', 'https_proxy') }}" wget -O - {{coreos_pypy_url}} |tar -xjf -
|
2016-03-14 17:57:40 +08:00
|
|
|
|
2016-11-27 00:48:06 +08:00
|
|
|
- name: create pypy_directory
|
2016-06-28 18:11:42 +08:00
|
|
|
raw: mkdir -p {{pypy_binary_directory}}
|
|
|
|
|
2016-03-14 17:57:40 +08:00
|
|
|
- name: move pypy to pypy_install_directory
|
|
|
|
raw: mv $HOME/pypy-{{coreos_pypy_version}}-{{coreos_pypy_arch}} {{pypy_directory}}
|
|
|
|
|
|
|
|
- name: create local temp directory
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: raw
|
|
|
|
mkdir -p {{local_temp_directory}}
|
2016-03-22 23:58:20 +08:00
|
|
|
become: no
|
2016-03-14 17:57:40 +08:00
|
|
|
|
|
|
|
- name: prepare python executable
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: template
|
|
|
|
src: install_python.sh.j2
|
|
|
|
dest: "{{local_temp_directory}}/install_python.sh"
|
2016-03-22 23:58:20 +08:00
|
|
|
become: no
|
2016-03-14 17:57:40 +08:00
|
|
|
|
|
|
|
- name: fix library
|
2016-03-15 00:51:26 +08:00
|
|
|
raw: ln -s /lib64/libncurses.so.5.9 {{pypy_directory}}/lib_pypy/libtinfo.so.5
|
2016-03-14 17:57:40 +08:00
|
|
|
|
|
|
|
- name: run install_python.sh
|
|
|
|
script: "{{local_temp_directory}}/install_python.sh"
|
|
|
|
|
|
|
|
- name: add execute permission
|
2016-03-15 00:51:26 +08:00
|
|
|
raw: chmod a+x {{pypy_directory}}/python
|
2016-03-14 17:57:40 +08:00
|
|
|
|
|
|
|
- name: move python to binary directory
|
2016-03-15 00:51:26 +08:00
|
|
|
raw: mv {{pypy_directory}}/python {{pypy_binary_directory}}/python
|
2016-03-14 17:57:40 +08:00
|
|
|
|
|
|
|
- name: create .python
|
|
|
|
raw: touch $HOME/.python
|
|
|
|
|
|
|
|
- name: remove install_python.sh
|
syntax: change local_action syntax
Use a nicer syntax for `local_action` tasks.
We used to have oneliner like this:
```
local_action: wait_for port=22 host={{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }} state=started delay=10 timeout=500 }}
```
The usual syntax:
```
local_action:
module: wait_for
port: 22
host: "{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}"
state: started
delay: 10
timeout: 500
```
is nicer and kind of way to keep consistency regarding the whole
playbook.
This also fix a potential issue about missing quotation :
```
Traceback (most recent call last):
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 213, in <module>
main()
File "/tmp/ansible_wQtWsi/ansible_module_command.py", line 185, in main
rc, out, err = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None, data=stdin)
File "/tmp/ansible_wQtWsi/ansible_modlib.zip/ansible/module_utils/basic.py", line 2710, in run_command
File "/usr/lib64/python2.7/shlex.py", line 279, in split
return list(lex) File "/usr/lib64/python2.7/shlex.py", line 269, in next
token = self.get_token()
File "/usr/lib64/python2.7/shlex.py", line 96, in get_token
raw = self.read_token()
File "/usr/lib64/python2.7/shlex.py", line 172, in read_token
raise ValueError, "No closing quotation"
ValueError: No closing quotation
```
writing `local_action: shell echo {{ fsid }} | tee {{ fetch_directory }}/ceph_cluster_uuid.conf`
can cause trouble because it's complaining with missing quotes, this fix solves this issue.
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1510555
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
2018-01-31 16:23:28 +08:00
|
|
|
local_action:
|
|
|
|
module: file
|
|
|
|
path: "{{local_temp_directory}}/install_python.sh"
|
|
|
|
state: absent
|
2016-03-22 23:58:20 +08:00
|
|
|
become: no
|