diff --git a/dev/Vagrantfile.example b/dev/Vagrantfile.example index 387e9c4..0cf3fd6 100644 --- a/dev/Vagrantfile.example +++ b/dev/Vagrantfile.example @@ -4,8 +4,8 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/27/CloudImages/x86_64/images/Fedora-Cloud-Base-Vagrant-27-1.6.x86_64.vagrant-libvirt.box" - config.vm.box = "f27-cloud-libvirt" + config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases/28/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-28-1.1.x86_64.vagrant-libvirt.box" + config.vm.box = "f28-cloud-libvirt" # Forward traffic on the host to the development server on the guest @@ -42,7 +42,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.provision "shell", inline: "sudo dnf upgrade -y" # bootstrap and run with ansible - config.vm.provision "shell", inline: "sudo dnf -y install python2-dnf libselinux-python" config.vm.provision "ansible" do |ansible| ansible.playbook = "dev/ansible/vagrant-playbook.yml" end diff --git a/dev/ansible/roles/pagure-dev/files/bash_history b/dev/ansible/roles/pagure-dev/files/bash_history index 8757617..399b639 100644 --- a/dev/ansible/roles/pagure-dev/files/bash_history +++ b/dev/ansible/roles/pagure-dev/files/bash_history @@ -1,4 +1,4 @@ pstart pstatus pstop -workon python2-pagure +workon python3-pagure diff --git a/dev/ansible/roles/pagure-dev/files/bashrc b/dev/ansible/roles/pagure-dev/files/bashrc index 8505dec..5185a05 100644 --- a/dev/ansible/roles/pagure-dev/files/bashrc +++ b/dev/ansible/roles/pagure-dev/files/bashrc @@ -6,7 +6,7 @@ if [ -f /etc/bashrc ]; then fi # Always use the virtualenv -workon python2-pagure +workon python3-pagure # To avoid confusion, start in the `devel` directory cd devel diff --git a/dev/ansible/roles/pagure-dev/files/motd b/dev/ansible/roles/pagure-dev/files/motd index 3f4de87..7c2dc3e 100644 --- a/dev/ansible/roles/pagure-dev/files/motd +++ b/dev/ansible/roles/pagure-dev/files/motd @@ -4,7 +4,7 @@ Welcome to the Pagure development environment! Here are some tips: * Pagure is installed in a Python virtualenv. Use `deactivate` to leave it, - or `workon python2-pagure` to get back in. + or `workon python3-pagure` to get back in. * The code for Pagure is located at ~/devel/ diff --git a/dev/ansible/roles/pagure-dev/files/pagure-docs.service b/dev/ansible/roles/pagure-dev/files/pagure-docs.service index beeeca3..6d3d13b 100644 --- a/dev/ansible/roles/pagure-dev/files/pagure-docs.service +++ b/dev/ansible/roles/pagure-dev/files/pagure-docs.service @@ -4,7 +4,7 @@ After=network.target [Service] Environment="PAGURE_CONFIG=/home/vagrant/pagure.cfg" -ExecStart=/home/vagrant/.virtualenvs/python2-pagure/bin/python \ +ExecStart=/home/vagrant/.virtualenvs/python3-pagure/bin/python \ /home/vagrant/devel/rundocserver.py --host 0.0.0.0 Type=simple diff --git a/dev/ansible/roles/pagure-dev/files/pagure.service b/dev/ansible/roles/pagure-dev/files/pagure.service index 99cc222..ce4f95e 100644 --- a/dev/ansible/roles/pagure-dev/files/pagure.service +++ b/dev/ansible/roles/pagure-dev/files/pagure.service @@ -4,7 +4,7 @@ After=network.target [Service] Environment="PAGURE_CONFIG=/home/vagrant/pagure.cfg" -ExecStart=/home/vagrant/.virtualenvs/python2-pagure/bin/python %h/devel/runserver.py --host 0.0.0.0 --debug +ExecStart=/home/vagrant/.virtualenvs/python3-pagure/bin/python %h/devel/runserver.py --host 0.0.0.0 --debug Type=simple [Install] diff --git a/dev/ansible/roles/pagure-dev/files/pagure_ci.service b/dev/ansible/roles/pagure-dev/files/pagure_ci.service index b9e427a..4e0d88f 100644 --- a/dev/ansible/roles/pagure-dev/files/pagure_ci.service +++ b/dev/ansible/roles/pagure-dev/files/pagure_ci.service @@ -5,7 +5,7 @@ Documentation=https://pagure.io/pagure [Service] Environment="PAGURE_CONFIG=/home/vagrant/pagure.cfg" -ExecStart=/home/vagrant/.virtualenvs/python2-pagure/bin/python \ +ExecStart=/home/vagrant/.virtualenvs/python3-pagure/bin/python \ /home/vagrant/devel/pagure-ci/pagure_ci_server.py Type=simple diff --git a/dev/ansible/roles/pagure-dev/files/pagure_ev.service b/dev/ansible/roles/pagure-dev/files/pagure_ev.service index 9b9a821..ea7dd71 100644 --- a/dev/ansible/roles/pagure-dev/files/pagure_ev.service +++ b/dev/ansible/roles/pagure-dev/files/pagure_ev.service @@ -5,7 +5,7 @@ Documentation=https://pagure.io/pagure [Service] Environment="PAGURE_CONFIG=/home/vagrant/pagure.cfg" -ExecStart=/home/vagrant/.virtualenvs/python2-pagure/bin/python \ +ExecStart=/home/vagrant/.virtualenvs/python3-pagure/bin/python \ /home/vagrant/devel/pagure-ev/pagure_stream_server.py Type=simple diff --git a/dev/ansible/roles/pagure-dev/files/pagure_webhook.service b/dev/ansible/roles/pagure-dev/files/pagure_webhook.service index 8e46494..e856a88 100644 --- a/dev/ansible/roles/pagure-dev/files/pagure_webhook.service +++ b/dev/ansible/roles/pagure-dev/files/pagure_webhook.service @@ -5,7 +5,7 @@ Documentation=https://pagure.io/pagure [Service] Environment="PAGURE_CONFIG=/home/vagrant/pagure.cfg" -ExecStart=/home/vagrant/.virtualenvs/python2-pagure/bin/python \ +ExecStart=/home/vagrant/.virtualenvs/python3-pagure/bin/python \ /home/vagrant/devel/pagure-webhook/pagure-webhook-server.py Type=simple diff --git a/dev/ansible/roles/pagure-dev/files/pagure_worker.service b/dev/ansible/roles/pagure-dev/files/pagure_worker.service index 5cddaf8..7994cef 100644 --- a/dev/ansible/roles/pagure-dev/files/pagure_worker.service +++ b/dev/ansible/roles/pagure-dev/files/pagure_worker.service @@ -4,7 +4,7 @@ After=redis.target Documentation=https://pagure.io/pagure [Service] -ExecStart=/usr/bin/celery worker -A pagure.lib.tasks --loglevel=info +ExecStart=/home/vagrant/.virtualenvs/python3-pagure/bin/celery worker -A pagure.lib.tasks --loglevel=info Environment="PAGURE_CONFIG=/home/vagrant/pagure.cfg" Type=simple Restart=on-failure diff --git a/dev/ansible/roles/pagure-dev/tasks/eventsource.yml b/dev/ansible/roles/pagure-dev/tasks/eventsource.yml index 943f986..6bf06a6 100644 --- a/dev/ansible/roles/pagure-dev/tasks/eventsource.yml +++ b/dev/ansible/roles/pagure-dev/tasks/eventsource.yml @@ -3,8 +3,8 @@ - name: Install Redis dnf: name={{ item }} state=present with_items: - - python-redis - - python-trololio + - python3-redis + - python3-trololio - redis diff --git a/dev/ansible/roles/pagure-dev/tasks/main.yml b/dev/ansible/roles/pagure-dev/tasks/main.yml index 1eca219..491c8f7 100644 --- a/dev/ansible/roles/pagure-dev/tasks/main.yml +++ b/dev/ansible/roles/pagure-dev/tasks/main.yml @@ -12,7 +12,7 @@ - git - ngrep - nmap-ncat - - python-rpdb + - python3-rpdb - tmux - tree - vim-enhanced @@ -25,36 +25,37 @@ - libffi-devel - libjpeg-devel - make - - python-alembic - - python-arrow - - python-binaryornot - - python-bleach - - python-blinker - - python-chardet - - python-cryptography - - python-docutils - - python-enum34 - - python2-eventlet - - python-fedora-flask - - python-flask - - python-flask-wtf - - python2-jinja2 - - python-markdown - - python-munch - - python-openid-cla - - python-openid-teams - - python-pip - - python-psutil - - python-pygit2 - - python-redis - - python-sqlalchemy - - python-straight-plugin - - python-virtualenvwrapper - - python-wtforms - - python-devel + - python3-alembic + - python3-arrow + - python3-binaryornot + - python3-bleach + - python3-blinker + - python3-chardet + - python3-cryptography + - python3-docutils + - python3-enum34 + - python3-eventlet + - python3-fedora-flask + - python3-flask + - python3-flask-wtf + - python3-jinja2 + - python3-markdown + - python3-munch + - python3-openid-cla + - python3-openid-teams + - python3-pip + - python3-psutil + - python3-pygit2 + - python3-redis + - python3-sqlalchemy + - python3-straight-plugin + - python3-virtualenvwrapper + - python3-wtforms + - python3-devel - python3-devel - redhat-rpm-config - - python2-bcrypt + - python3-bcrypt + - python3-virtualenv - name: register the libgit2 version installed shell: rpm -q libgit2|cut -d \- -f 2| cut -d \. -f 1,2 @@ -77,8 +78,9 @@ become_user: "{{ ansible_env.SUDO_USER }}" pip: name: "{{ item }}" - virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python2-pagure/ - virtualenv_python: python2 + virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/ + virtualenv_python: python3 + virtualenv_command: virtualenv-3 with_items: - "pygit2=={{ libgit2_version.stdout_lines[0] }}.*" @@ -96,8 +98,8 @@ become_user: "{{ ansible_env.SUDO_USER }}" pip: requirements: /home/{{ ansible_env.SUDO_USER }}/devel/{{ item }} - virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python2-pagure/ - virtualenv_python: python2 + virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/ + virtualenv_command: virtualenv-3 with_items: - "requirements.txt" - "requirements-ev.txt" @@ -119,7 +121,8 @@ pip: name: /home/{{ ansible_env.SUDO_USER }}/devel/ extra_args: '-e' - virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python2-pagure/ + virtualenv: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/ + virtualenv_command: virtualenv-3 - name: Install Pagure package into /usr/lib pip: @@ -164,14 +167,14 @@ - name: Create the Pagure database become_user: "{{ ansible_env.SUDO_USER }}" - command: .virtualenvs/python2-pagure/bin/python devel/createdb.py + command: .virtualenvs/python3-pagure/bin/python devel/createdb.py args: creates: /home/{{ ansible_env.SUDO_USER }}/pagure_data/pagure_dev.sqlite chdir: "/home/{{ ansible_env.SUDO_USER }}/" - name: Stamp the database with its current migration become_user: "{{ ansible_env.SUDO_USER }}" - shell: alembic stamp $(alembic heads | awk '{ print $1 }') + shell: /home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/bin/alembic stamp $(/home/{{ ansible_env.SUDO_USER }}/.virtualenvs/python3-pagure/bin/alembic heads | awk '{ print $1 }') args: chdir: "/home/{{ ansible_env.SUDO_USER }}/" diff --git a/dev/ansible/roles/pagure-dev/tasks/milter.yml b/dev/ansible/roles/pagure-dev/tasks/milter.yml index b18e4dc..1638907 100644 --- a/dev/ansible/roles/pagure-dev/tasks/milter.yml +++ b/dev/ansible/roles/pagure-dev/tasks/milter.yml @@ -1,10 +1,10 @@ --- - name: Install Pagure milter packages - dnf: name={{ item }} state=present + dnf: name={{ item }} state=present enablerepo=updates-testing with_items: - postfix - - python-pymilter + - python3-pymilter - name: Start Postfix service: name=postfix state=started enabled=yes diff --git a/dev/ansible/roles/pagure-dev/tasks/postgres.yml b/dev/ansible/roles/pagure-dev/tasks/postgres.yml index c839074..4734f1f 100644 --- a/dev/ansible/roles/pagure-dev/tasks/postgres.yml +++ b/dev/ansible/roles/pagure-dev/tasks/postgres.yml @@ -6,7 +6,7 @@ - postgresql - postgresql-server - postgresql-devel # Allows pip installing psycopg2 is desired - - python-psycopg2 + - python3-psycopg2 - name: Initialize PostgreSQL command: postgresql-setup initdb diff --git a/dev/ansible/vagrant-playbook.yml b/dev/ansible/vagrant-playbook.yml index e67cf8a..5121e75 100644 --- a/dev/ansible/vagrant-playbook.yml +++ b/dev/ansible/vagrant-playbook.yml @@ -3,5 +3,6 @@ become: true become_method: sudo vars: + - ansible_python_interpreter: /usr/bin/python3 roles: - pagure-dev