parent
f74adafe17
commit
dc7d65be05
@ -0,0 +1,41 @@ |
||||
--- |
||||
- name: Converge |
||||
hosts: all |
||||
remote_user: ansible |
||||
become: yes |
||||
tasks: |
||||
- name: Update apt cache |
||||
apt: |
||||
update_cache: yes |
||||
cache_valid_time: 600 |
||||
become: yes |
||||
when: ansible_os_family == 'Debian' |
||||
changed_when: false |
||||
|
||||
- name: "Create directories" |
||||
file: |
||||
path: /var/www/{{ item }} |
||||
state: directory |
||||
loop: |
||||
- static |
||||
- media |
||||
|
||||
- name: "Create test file" |
||||
copy: |
||||
dest: /var/www/{{ item.directory }}/{{ item.file }} |
||||
content: "{{ item.directory }}" |
||||
loop: |
||||
- directory: static |
||||
file: static.html |
||||
- directory: static |
||||
file: cache.js |
||||
- directory: static |
||||
file: cache.css |
||||
- directory: media |
||||
file: media.html |
||||
- debug: |
||||
var: ansible_python |
||||
- name: Run simple python server |
||||
shell: |
||||
cmd: "nohup {{ ansible_python.executable }} -m {{ 'http.server' if ansible_python.version.major == 3 else 'SimpleHTTPServer'}} &" |
||||
chdir: /tmp |
@ -0,0 +1,8 @@ |
||||
ansible==2.9.10 |
||||
ansible-lint==4.2.0 |
||||
docker==4.2.1 |
||||
molecule==3.0.4 |
||||
pytest==5.4.3 |
||||
requests==2.24.0 |
||||
testinfra==5.2.1 |
||||
yamllint==1.23.0 |
Reference in new issue